[pgpool-general: 7400] Re: non-default tablespaces

Tatsuo Ishii ishii at sraoss.co.jp
Sun Jan 17 09:59:31 JST 2021

Oh I see.

pg_basebackup tries to create the tablespace directories, or tires to
confirm that the tablespace directories are empty before
proceeding. So you need to rm or rename those directories to be used
for tablespaces before executing pg_basebackup in the scripts.

Another way to deal with this is, using brand new directories for
tablespaces and specify them by using pg_baseback's -T option.

> https://www.postgresql.org/docs/13/sql-createtablespace.html
> Sent from my iPad
>> On 16 Jan 2021, at 13:59, Tatsuo Ishii <ishii at sraoss.co.jp> wrote:
>> How did you create the tablespace? Something like below?
>> mkdir /u01/pgdata/temp
>> copy /var/lib/pgsql/13/data into /u01/pgdata/temp
>> rm -fr /var/lib/pgsql/13/data
>> ln -s /u01/pgdata/temp /var/lib/pgsql/13/data
>>> temp_tablespaces=temp is in the postgresql.conf
>>> there is no entry related with the tablespaces in pgpool.conf.
>>>> On Sat, Jan 16, 2021 at 1:16 PM Murat K <srvrmurat at gmail.com> wrote:
>>>> This is the setup Pgpool-II + Watchdog Setup Example
>>>> <https://www.pgpool.net/docs/latest/en/html/example-cluster.html>
>>>> When running pcp_recovery_node script, it logs:
>>>> pg_basebackup: error: directory "/u01/pgdata/temp" exists but is not empty
>>>> pg_basebackup: removing data directory "/var/lib/pgsql/13/data"
>>>> Moving directory is necessary  for pcp_recovery_node to run.
>>>> When failover is triggered new primary runs but standby does not follow
>>>> the new primary.
>>>> In pgpool.conf tablespace related configuration is:
>>>> temp_tablespaces = temp
>>>> Regards
>>>>> On Sat, Jan 16, 2021 at 12:22 PM Tatsuo Ishii <ishii at sraoss.co.jp> wrote:
>>>>>> Dear Tatsuo,
>>>>>> I am implementing example setup on pgpool website. Nothing different
>>>>> from
>>>>>> setup. It runs successfully. In case of failover, standby follows the
>>>>> new
>>>>>> primary db and syncronizes. What I see is /var/lib/pgsql/13/data is
>>>>> moved
>>>>>> to .../data.old.
>>>>> Can you tell me the exact url of "example setup on pgpool website"?
>>>>> IMO there is no code doing "mv data to data.old" in the sample scripts
>>>>> provided by the official pgpool sample scripts.
>>>>>> Then I created two non-default tablespaces in /u01/xxx and /u01/yyy.
>>>>> Tried
>>>>>> the failover but it is not working. It looks follow_primary.sh is not
>>>>>> working as before. I could not find any clue. Shall I move non-default
>>>>>> tablespaces to xxx.old, yyy.old at beginning of follow_primary.sh? What
>>>>> is
>>>>>> the proper way of working with non-defult tablespaces?
>>>>> That depends how you use the tablespaces. Can you share pgpool.conf?
>>>>> It should tell how you use the tablespaces.
>>>>>> Thanks,
>>>>>> murat
>>>>>> On Fri, Jan 15, 2021 at 11:43 AM Tatsuo Ishii <ishii at sraoss.co.jp>
>>>>> wrote:
>>>>>>>> Dear All,
>>>>>>>> My configuration is pgpool 4.2.1, postgresql-13 and centos7. I have
>>>>>>>> non-default tablespaces. It looks in case of recovery and failover
>>>>> it is
>>>>>>>> not working as I anticipated. As far as I see pgpool moves var
>>>>> directory
>>>>>>> to
>>>>>>>> var.old but for non-default tablespace directories it does not behave
>>>>>>> like
>>>>>>>> that. What is the proper way of working with non-default tablespaces?
>>>>>>> Can you elaborate more? How exactly Pgpool-II does not work as you
>>>>>>> expected?  Since for recovery and failover you need to provide scripts
>>>>>>> to perform actual recovery and failover, without sharing those scripts
>>>>>>> I cannot say anything about what's wrong.
>>>>>>> Also I don't understand "pgpool moves var directory to var.old"
>>>>>>> because Pgpool-II does not have code that does that.
>>>>>>> Best regards,
>>>>>>> --
>>>>>>> Tatsuo Ishii
>>>>>>> SRA OSS, Inc. Japan
>>>>>>> English: http://www.sraoss.co.jp/index_en.php
>>>>>>> Japanese:http://www.sraoss.co.jp

More information about the pgpool-general mailing list