Re: streaming replication does not work across datacenter with 20ms latency?

От: Tomas Vondra
Тема: Re: streaming replication does not work across datacenter with 20ms latency?
Дата: ,
Msg-id: 4E2C8067.2010803@fuzzy.cz
(см: обсуждение, исходный текст)
Ответ на: Re: streaming replication does not work across datacenter with 20ms latency?  (Yan Chunlu)
Ответы: Re: streaming replication does not work across datacenter with 20ms latency?  (Yan Chunlu)
Список: pgsql-general

Скрыть дерево обсуждения

streaming replication does not work across datacenter with 20ms latency?  (Yan Chunlu, )
 Re: streaming replication does not work across datacenter with 20ms latency?  (Scott Ribe, )
  Re: streaming replication does not work across datacenter with 20ms latency?  (Yan Chunlu, )
   Re: streaming replication does not work across datacenter with 20ms latency?  ("Tomas Vondra", )
    Re: streaming replication does not work across datacenter with 20ms latency?  ("Joshua D. Drake", )
    Re: streaming replication does not work across datacenter with 20ms latency?  (Scott Marlowe, )
     Re: streaming replication does not work across datacenter with 20ms latency?  (Yan Chunlu, )
      Re: streaming replication does not work across datacenter with 20ms latency?  (Adrian Klaver, )
      Re: streaming replication does not work across datacenter with 20ms latency?  (Scott Ribe, )
       Re: streaming replication does not work across datacenter with 20ms latency?  (Yan Chunlu, )
        Re: streaming replication does not work across datacenter with 20ms latency?  ("Tomas Vondra", )
         Re: streaming replication does not work across datacenter with 20ms latency?  (Yan Chunlu, )
          Re: streaming replication does not work across datacenter with 20ms latency?  (Yan Chunlu, )
          Re: streaming replication does not work across datacenter with 20ms latency?  (Tomas Vondra, )
           Re: streaming replication does not work across datacenter with 20ms latency?  (Yan Chunlu, )
            Re: streaming replication does not work across datacenter with 20ms latency?  (Fujii Masao, )
             Re: streaming replication does not work across datacenter with 20ms latency?  (Simon Riggs, )
             Re: streaming replication does not work across datacenter with 20ms latency?  (Yan Chunlu, )
              Re: streaming replication does not work across datacenter with 20ms latency?  (Yan Chunlu, )
              Re: streaming replication does not work across datacenter with 20ms latency?  ("Tomas Vondra", )
               Re: streaming replication does not work across datacenter with 20ms latency?  (Yan Chunlu, )
               Re: streaming replication does not work across datacenter with 20ms latency?  (Tom Lane, )
                Re: streaming replication does not work across datacenter with 20ms latency?  (Yan Chunlu, )
                 Re: streaming replication does not work across datacenter with 20ms latency?  (Tom Lane, )
                  Re: streaming replication does not work across datacenter with 20ms latency?  (Yan Chunlu, )
               Re: streaming replication does not work across datacenter with 20ms latency?  (Michael Nolan, )
         pgpool HA not working  (Sanjay Rao, )
       Re: streaming replication does not work across datacenter with 20ms latency?  (Yan Chunlu, )
     Re: streaming replication does not work across datacenter with 20ms latency?  (Yan Chunlu, )
      Re: streaming replication does not work across datacenter with 20ms latency?  (Scott Marlowe, )
    Re: streaming replication does not work across datacenter with 20ms latency?  (Yan Chunlu, )
 Re: streaming replication does not work across datacenter with 20ms latency?  (Tom Lane, )
 Re: streaming replication does not work across datacenter with 20ms latency?  (Yan Chunlu, )
 Re: streaming replication does not work across datacenter with 20ms latency?  (Tom Lane, )

Dne 24.7.2011 14:46, Yan Chunlu napsal(a):
> checkpoint_segments = 64
> wal_keep_segments = 128

This information alone is not sufficient - we don't know how much write
activity is on the primary system, so we can't say if those number are
sufficient or not. You have to tune them according to write activity on
the primary server.

For example let's suppose the current WAL segment on the primary is "1"
and that it's configured with wal_keep_segments = 5 (i.e. about 80MB of
data).

Before you prepare and start the slave machine, someone writes 100MB of
data to the primary database (one big insert/update or a lot of small
ones, doesn't matter). 100MB is about 6 WAL segments, so the current WAL
segment on the primary is 7, and because of wal_keep_segments there are
segments 3,4,5,6,7 available.

But when the slave connects, it asks for segment no. 2 and it's not
available. It's not possible to skip that segment so the replication
fails to start.

If the primary only received 60MB of data, it'd probably worked (there'd
be enough segments kept on the primary).

Those 128 segments is about 2GB of data. How much data is written on the
primary between creating a filesystem copy and starting the slave?

You don't neet to keep the files on the master, you can set up archiving
and keep them somewhere else (on a different system etc.).

Tomas



В списке pgsql-general по дате сообщения:

От: Yan Chunlu
Дата:
Сообщение: Re: streaming replication does not work across datacenter with 20ms latency?
От: Pablo Romero Abiti
Дата:
Сообщение: Re : Re : Update columns in same table from update trigger?