|
|
|
Потоковая репликация
|
|||
|---|---|---|---|
|
#18+
laanetВсем спасибо. Плюнул на все и поставил repmgr репликацию. Попробую ее. В тесте показывает хорошую работу. repmgr это набор скриптов, удобная надстройка над коробочной постгресовой streaming replication. Имхо у вас все и так было нормально, лаг вполне нормальный. Но вот выборочное копирование датфайлов это конечно перебор))) ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.02.2014, 16:26:09 |
|
||
|
Потоковая репликация
|
|||
|---|---|---|---|
|
#18+
laanet, авторrepmgr дак вы ничего не поменяли. у вас пролбема не в "репликации", а в битой куче ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.02.2014, 17:46:44 |
|
||
|
Потоковая репликация
|
|||
|---|---|---|---|
|
#18+
Спасибо Михайлу и всем коллегам. VACUUM с vacuum_freeze_table_age = 0 помогло. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 27.02.2014, 11:25:07 |
|
||
|
Потоковая репликация
|
|||
|---|---|---|---|
|
#18+
А вообще похоже влияют параметры max_standby_archive_delay и max_standby_streaming_delay. Вернул по умолчанию. Было -1. Проверю. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 27.02.2014, 11:44:20 |
|
||
|
Потоковая репликация
|
|||
|---|---|---|---|
|
#18+
laanet, -1 в них, да, то еще зло ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 27.02.2014, 12:57:12 |
|
||
|
Потоковая репликация
|
|||
|---|---|---|---|
|
#18+
Опять с репликой чудеса. Работает select tx.id from transactions tx inner join deal_contractor dc on(tx.deal_id = dc.deal_id) inner join transaction_revenue tr on (tr.deal_contractor_id = dc.id and tr.transaction_id = tx.id) where status = 'success' and deal_role = 'provider-bank' and dc.contractor_id = 32 and merchant_additional::json->>'auth_code' = '009714' and date(tx.provider_tx_datetime) = '2014-02-27' А select tx.id from transactions tx inner join deal_contractor dc on(tx.deal_id = dc.deal_id) inner join transaction_revenue tr on (tr.deal_contractor_id = dc.id and tr.transaction_id = tx.id) where status = 'success' and deal_role = 'provider-bank' and dc.contractor_id = 32 and merchant_additional::json->>'auth_code' = '009714' and date(tr.provider_tx_datetime) = '2014-02-27' Нет. На мастере все нормально отрабатывает. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 04.03.2014, 12:58:12 |
|
||
|
Потоковая репликация
|
|||
|---|---|---|---|
|
#18+
laanetОпять с репликой чудеса. Работает select tx.id from transactions tx inner join deal_contractor dc on(tx.deal_id = dc.deal_id) inner join transaction_revenue tr on (tr.deal_contractor_id = dc.id and tr.transaction_id = tx.id) where status = 'success' and deal_role = 'provider-bank' and dc.contractor_id = 32 and merchant_additional::json->>'auth_code' = '009714' and date(tx.provider_tx_datetime) = '2014-02-27' А select tx.id from transactions tx inner join deal_contractor dc on(tx.deal_id = dc.deal_id) inner join transaction_revenue tr on (tr.deal_contractor_id = dc.id and tr.transaction_id = tx.id) where status = 'success' and deal_role = 'provider-bank' and dc.contractor_id = 32 and merchant_additional::json->>'auth_code' = '009714' and date(tr.provider_tx_datetime) = '2014-02-27' Нет. На мастере все нормально отрабатывает. а что показывает select * from pg_stat_replication; ? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 04.03.2014, 13:20:12 |
|
||
|
Потоковая репликация
|
|||
|---|---|---|---|
|
#18+
На мастере 29723;10;"postgres";"walreceiver";"192.168.100.11";"";54436;"2014-03-03 20:08:57.267225+04";"streaming";"291/ADB00128";"291/ADB00128";"291/ADB00128";"291/ADB00070";0;"async" А на слейве ничего. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 04.03.2014, 13:35:41 |
|
||
|
Потоковая репликация
|
|||
|---|---|---|---|
|
#18+
laanetНа мастере 29723;10;"postgres";"walreceiver";"192.168.100.11";"";54436;"2014-03-03 20:08:57.267225+04";"streaming";"291/ADB00128";"291/ADB00128";"291/ADB00128";"291/ADB00070";0;"async" А на слейве ничего. вроде реплика не отстает... а пришлите explain analyze для обоих запросов выполенный на реплике ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 04.03.2014, 13:52:46 |
|
||
|
Потоковая репликация
|
|||
|---|---|---|---|
|
#18+
На слейве "Nested Loop (cost=6277.68..8159.49 rows=1 width=4) (actual time=65.403..65.403 rows=0 loops=1)" " Join Filter: (dc.deal_id = tx.deal_id)" " -> Nested Loop (cost=6277.24..7737.84 rows=95 width=8) (actual time=65.403..65.403 rows=0 loops=1)" " -> Bitmap Heap Scan on deal_contractor dc (cost=2.30..12.28 rows=1 width=8) (actual time=0.011..0.018 rows=2 loops=1)" " Recheck Cond: (contractor_id = 32)" " Filter: ((deal_role)::text = 'provider-bank'::text)" " Rows Removed by Filter: 2" " -> Bitmap Index Scan on deal_contractor_contractor_id (cost=0.00..2.30 rows=6 width=0) (actual time=0.005..0.005 rows=4 loops=1)" " Index Cond: (contractor_id = 32)" " -> Bitmap Heap Scan on transaction_revenue tr (cost=6274.94..7724.83 rows=735 width=8) (actual time=32.687..32.687 rows=0 loops=2)" " Recheck Cond: ((deal_contractor_id = dc.id) AND (date(provider_tx_datetime) = '2014-02-27'::date))" " -> BitmapAnd (cost=6274.94..6274.94 rows=735 width=0) (actual time=32.633..32.633 rows=0 loops=2)" " -> Bitmap Index Scan on tr_dc_idx (cost=0.00..2329.34 rows=71781 width=0) (actual time=8.697..8.697 rows=60446 loops=2)" " Index Cond: (deal_contractor_id = dc.id)" " -> Bitmap Index Scan on tr_prv_dt_t_id (cost=0.00..3878.50 rows=266646 width=0) (actual time=18.520..18.520 rows=286212 loops=2)" " Index Cond: (date(provider_tx_datetime) = '2014-02-27'::date)" " -> Index Scan using tx_idx on transactions tx (cost=0.44..4.43 rows=1 width=8) (never executed)" " Index Cond: (id = tr.transaction_id)" " Filter: (((status)::text = 'success'::text) AND (((merchant_additional)::json ->> 'auth_code'::text) = '009714'::text))" "Total runtime: 65.456 ms" На мастере "Nested Loop (cost=6277.68..8159.49 rows=1 width=4) (actual time=175.890..349.431 rows=1 loops=1)" " Join Filter: (dc.deal_id = tx.deal_id)" " -> Nested Loop (cost=6277.24..7737.84 rows=95 width=8) (actual time=158.652..257.113 rows=4007 loops=1)" " -> Bitmap Heap Scan on deal_contractor dc (cost=2.30..12.28 rows=1 width=8) (actual time=0.081..0.087 rows=2 loops=1)" " Recheck Cond: (contractor_id = 32)" " Filter: ((deal_role)::text = 'provider-bank'::text)" " Rows Removed by Filter: 2" " -> Bitmap Index Scan on deal_contractor_contractor_id (cost=0.00..2.30 rows=6 width=0) (actual time=0.066..0.066 rows=4 loops=1)" " Index Cond: (contractor_id = 32)" " -> Bitmap Heap Scan on transaction_revenue tr (cost=6274.94..7724.83 rows=735 width=8) (actual time=118.913..127.679 rows=2004 loops=2)" " Recheck Cond: ((deal_contractor_id = dc.id) AND (date(provider_tx_datetime) = '2014-02-27'::date))" " -> BitmapAnd (cost=6274.94..6274.94 rows=735 width=0) (actual time=118.098..118.098 rows=0 loops=2)" " -> Bitmap Index Scan on tr_dc_idx (cost=0.00..2329.34 rows=71781 width=0) (actual time=36.874..36.874 rows=73422 loops=2)" " Index Cond: (deal_contractor_id = dc.id)" " -> Bitmap Index Scan on tr_prv_dt_t_id (cost=0.00..3878.50 rows=266646 width=0) (actual time=59.815..59.815 rows=286212 loops=2)" " Index Cond: (date(provider_tx_datetime) = '2014-02-27'::date)" " -> Index Scan using tx_idx on transactions tx (cost=0.44..4.43 rows=1 width=8) (actual time=0.022..0.022 rows=0 loops=4007)" " Index Cond: (id = tr.transaction_id)" " Filter: (((status)::text = 'success'::text) AND (((merchant_additional)::json ->> 'auth_code'::text) = '009714'::text))" " Rows Removed by Filter: 1" "Total runtime: 349.558 ms" ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 04.03.2014, 14:26:51 |
|
||
|
Потоковая репликация
|
|||
|---|---|---|---|
|
#18+
laanet, а что говорит на мастере select pg_xlog_location_diff(pg_current_xlog_location(),sent_location) as diff1, pg_xlog_location_diff(pg_current_xlog_location(),replay_location) as diff2 from pg_stat_replication; ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 04.03.2014, 14:44:58 |
|
||
|
Потоковая репликация
|
|||
|---|---|---|---|
|
#18+
0 58567856 ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 04.03.2014, 14:50:46 |
|
||
|
Потоковая репликация
|
|||
|---|---|---|---|
|
#18+
laanet, Вы после VACUUM с vacuum_freeze_table_age = 0 реплику пересоздали? Нужно пересоздать. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 04.03.2014, 20:49:03 |
|
||
|
Потоковая репликация
|
|||
|---|---|---|---|
|
#18+
Пересоздал. Пока запросы работают правильно. Наблюдаю. Спасибо. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 06.03.2014, 11:09:22 |
|
||
|
Потоковая репликация
|
|||
|---|---|---|---|
|
#18+
laanetПересоздал. Пока запросы работают правильно. Наблюдаю. Спасибо. Опять интересно. Делаю на мастере select * from transactions where id in (51134118,51149871,51166878,51179828,51200926,51202296,51207871,51227088,51227544,51256647,51257732,51260336,51275742) все хорошо. На слейве пусто. Делаю на мастере update transactions set updated_at=updated_at where id in (51134118, 51149871,51166878,51179828,51200926,51202296,51207871,51227088,51227544,51256647,51257732,51260336,51275742) На слейве тут же появляются записи. При этом до апдейта новые базы и таблицы появляются на слейве. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 12.03.2014, 12:05:28 |
|
||
|
Потоковая репликация
|
|||
|---|---|---|---|
|
#18+
laanetlaanetПересоздал. Пока запросы работают правильно. Наблюдаю. Спасибо. Опять интересно. Делаю на мастере select * from transactions where id in (51134118,51149871,51166878,51179828,51200926,51202296,51207871,51227088,51227544,51256647,51257732,51260336,51275742) все хорошо. На слейве пусто. Делаю на мастере update transactions set updated_at=updated_at where id in (51134118, 51149871,51166878,51179828,51200926,51202296,51207871,51227088,51227544,51256647,51257732,51260336,51275742) На слейве тут же появляются записи. При этом до апдейта новые базы и таблицы появляются на слейве. кроме предложения воспроизвести проблему на какой то отдельной таблице специально сделанной т.е. сделать test case и его прислать - я вам тут ничего посоветовать не могу... будет test case - посмотрю что и как и если сам не разберусь напишу разработчикам... ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 12.03.2014, 12:55:09 |
|
||
|
Потоковая репликация
|
|||
|---|---|---|---|
|
#18+
Maxim Boguklaanetпропущено... Опять интересно. Делаю на мастере select * from transactions where id in (51134118,51149871,51166878,51179828,51200926,51202296,51207871,51227088,51227544,51256647,51257732,51260336,51275742) все хорошо. На слейве пусто. Делаю на мастере update transactions set updated_at=updated_at where id in (51134118, 51149871,51166878,51179828,51200926,51202296,51207871,51227088,51227544,51256647,51257732,51260336,51275742) На слейве тут же появляются записи. При этом до апдейта новые базы и таблицы появляются на слейве. кроме предложения воспроизвести проблему на какой то отдельной таблице специально сделанной т.е. сделать test case и его прислать - я вам тут ничего посоветовать не могу... будет test case - посмотрю что и как и если сам не разберусь напишу разработчикам... А как его сделать? Ведь закономерности нет. Делаю таблицу. Вставляю в нее. Все хорошо. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 12.03.2014, 13:05:13 |
|
||
|
|

start [/forum/topic.php?fid=53&msg=38569064&tid=1998797]: |
0ms |
get settings: |
6ms |
get forum list: |
9ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
147ms |
get topic data: |
9ms |
get forum data: |
2ms |
get page messages: |
77ms |
get tp. blocked users: |
1ms |
| others: | 218ms |
| total: | 477ms |

| 0 / 0 |
