Skip to content

Bir Cuma günü heyecanı daha

2 hafta önce Cuma günü yine kara bir gün olarak bitmişti.  Bu Cuma da öyle oldu.

Keyifle 11:30 sularında uyandım. 12:00'da (Eastern 05:00 tabii, yoksa öğlen bu iş yapılmaz :-) ) bir Slony-I replikasyon kümesine bir tablo ekleyecektim.


Normalde 3-4 dakika sürer sürmez. Nitekim o kadar sürdü ve tabloyu replikasyona ekledim. Buraya kadar sorun yok. Müşterimizin bir gereksinmesi daha vardı: 999 numaralı replikasyon kümesini yeni yaratttığım 3 numaralı küme ile birleştirmek (merge set). Bu da yine saniyeler içinde bitecek bir olay. Tabii aslında bu süreçte önemli olan birşey var: Kümelerdeki tablo idleri tekil olmalı -- benzer şey sequence numaraları için de geçerli. Ben sayılara baktım. 3000 boştu :(2030 da boştu gerçi ama sayının önemi olmadığı için 3000 verdim).



Merge işleminde bir hata almadım. Ama sonra tabii ki durumu kontrol etmek gerekiyordu. sl_status tablosuna baktım:


# SELECT * from _replica.sl_status;
st_origin | st_received | st_last_event | st_last_event_ts | st_last_received | st_last_received_ts | st_last_received_event_ts | st_lag_num_events | st_lag_time
-----------+-------------+---------------+---------------------------+------------------+----------------------------+----------------------------+-------------------+-----------------
2 | 4 | 2671446 | 2009-04-10 02:59:42.71336 | 2671235 | 2009-04-10 02:16:17.749945 | 2009-04-10 02:16:17.562136 | 211 | 00:43:27.090402
2 | 1 | 2671446 | 2009-04-10 02:59:42.71336 | 2671446 | 2009-04-10 02:59:42.81505 | 2009-04-10 02:59:42.71336 | 0 | 00:00:01.939178
2 | 3 | 2671446 | 2009-04-10 02:59:42.71336 | 2671446 | 2009-04-10 02:59:42.871676 | 2009-04-10 02:59:42.71336 | 0 | 00:00:01.939178
(3 rows)


Ohh:) Gecikme var. Loglara baktım:


2009-04-10 03:00:46 PDT [11553] DEBUG2 remoteWorkerThread_2: all tables for set 3 found on subscriber
2009-04-10 03:00:46 PDT [11553] DEBUG2 remoteWorkerThread_2: copy sequence "public"."rev_marketmap_pk_marketmap_id_seq"
2009-04-10 03:00:46 PDT [11553] ERROR remoteWorkerThread_2: "select "_replica".setAddSequence_int(3, 2015, '"public"."rev_marketmap_pk_marketmap_id_seq"', 'Sequence public.rev_marketmap_pk_marketmap_id_seq')" PGRES_FATAL_ERROR ERROR: Slony-I: setAddSequence_int(): sequence ID 2015 has already been assigned
2009-04-10 03:00:46 PDT [11553] WARN remoteWorkerThread_2: data copy for set 3 failed - sleep 60 seconds

İşte kafamı kaşıdığım yer burası idi. Mevcut bir kümedeki mevcut bir id neden bu derdi çıkartırdı ki? Hemen slon_tools.conf dosyasına baktım. Emin oldum ki 3000 yazmışım oraya.

Şimdi? İlk aklıma gelen son tabloyu replikasyondan ayırmak ve yeniden create_set ve subscribe_set ile eklemek oldu.Sonuç ? Değişmedi :-)

Bu arada lag artıyordu. Oğluşumla biraz dolaşıp kendime geldikten sonra sakin kafa ile tekrar daldım konuya. Bu sefer logda sorunlu gözüken sequence ve onun tablosunu ayırayım dedim. Fikir fena değildi. Aslında işe de yaradı: :-P

Apr 10 10:00:21 [slon] [100074-1] 2009-04-10 10:00:21 PDT [11553] DEBUG2 remoteWorkerThread_2: all tables for set 3 found on subscriber
Apr 10 10:00:21 [slon] [100075-1] 2009-04-10 10:00:21 PDT [11553] DEBUG2 remoteWorkerThread_2: copy sequence "public"."rev_marketzip_pk_marketzip_id_seq"
Apr 10 10:00:21 [slon] [100076-1] 2009-04-10 10:00:21 PDT [11553] ERROR remoteWorkerThread_2: "select "_replica".setAddSequence_int(3, 2016,
Apr 10 10:00:21 [slon] [100076-2] '"public"."rev_marketzip_pk_marketzip_id_seq"', 'Sequence public.rev_marketzip_pk_marketzip_id_seq')" PGRES_FATAL_ERROR ERROR:
Apr 10 10:00:21 [slon] [100076-3] Slony-I: setAddSequence_int(): sequence ID 2016 has already been assigned

Neymiş? İşe yaramış ama sorunu ötelemişiz sadece ileriye doğru. Her tabloyu teker teker ayıracağıma replikasyonu baştan başlatmaya karar verdik.

İn-bin olacak ama yapacak birşey yok. Arada da Slony-I 1.2.15'e geçeceğiz. (2.0 serisini kullanamıyoruz; zira PostgreSQL 8.1 var burada)

Başıma gelen tek şey bu değil. Onu da ayrı bir günlük girdisi olarak yazacağım.

Trackbacks

MadBlog on : Aynı Cuma'da bir dert daha

Show preview
Az önce yazdım; bugün kara bir gündü diye... Ama tek olay o değildi.Oğlum beni arayıp "Baba, oyuncak araba götür" (jetonla çalışan ve araba, atlı karınca vs olan yerlerden bahsediyor ) deyince ve ben de replikasyon derdinden fazlası ile b

MadBlog on : Cumartesi gecesi ateşi

Show preview
Dünkü Slony-I sorununu kalıcı şekilde aşmak için dün gece işe koyuldum.İşe tüm nodelardaki fonksiyonları güncelleyerek başladım -- zira Slony-I güncellemesi de vardı (slonik_update_nodes). Ardından setleri unsubscribe ettim, sonra setleri kaldırdı

Comments

Display comments as Linear | Threaded

No comments

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA


To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

Form options