Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the fail if a tablespace path has PGDATA(#141) #210

Merged
merged 1 commit into from
Sep 5, 2022

Conversation

mikecaat
Copy link
Contributor

Previously, if the server has a tablespace and
its path has PGDATA's path, the restore
fails because mkdirs.sh doesn't work.

For example, the following case fails to restore.

  • PGDATA path: /tmp/pgdata
  • tablespace path: /tmp/pgdata_tblspc

So, this patch fixes the case. The root cause
is the logic checking whether the file taking backup
is in tablespace or PGDATA.

Because it only considers their prefix, if the prefix
path of tablespace is the same as PGDATA, it decides
the file is in PGDATA.

So, this patch changes the logic to check it has '/'
after the prefix.

Previously, if the server has a tablespace and
its path has PGDATA's path, the restore
fails because mkdirs.sh doesn't work.

For example, the following case fails to restore.

* PGDATA path: /tmp/pgdata
* tablespace path: /tmp/pgdata_tblspc

So, this patch fixes the case. The root cause
is the logic checking whether the file taking backup
is in tablespace or PGDATA.

Because it only considers their prefix, if the prefix
path of tablespace is the same as PGDATA, it decides
the file is in PGDATA.

So, this patch changes the logic to check it has '/'
after the prefix.
@huangfumingyue huangfumingyue merged commit 31b1e57 into ossc-db:master Sep 5, 2022
huangfumingyue pushed a commit that referenced this pull request Sep 5, 2022
Previously, if the server has a tablespace and
its path has PGDATA's path, the restore
fails because mkdirs.sh doesn't work.

For example, the following case fails to restore.

* PGDATA path: /tmp/pgdata
* tablespace path: /tmp/pgdata_tblspc

So, this patch fixes the case. The root cause
is the logic checking whether the file taking backup
is in tablespace or PGDATA.

Because it only considers their prefix, if the prefix
path of tablespace is the same as PGDATA, it decides
the file is in PGDATA.

So, this patch changes the logic to check it has '/'
after the prefix.
huangfumingyue pushed a commit that referenced this pull request Sep 5, 2022
Previously, if the server has a tablespace and
its path has PGDATA's path, the restore
fails because mkdirs.sh doesn't work.

For example, the following case fails to restore.

* PGDATA path: /tmp/pgdata
* tablespace path: /tmp/pgdata_tblspc

So, this patch fixes the case. The root cause
is the logic checking whether the file taking backup
is in tablespace or PGDATA.

Because it only considers their prefix, if the prefix
path of tablespace is the same as PGDATA, it decides
the file is in PGDATA.

So, this patch changes the logic to check it has '/'
after the prefix.
huangfumingyue pushed a commit that referenced this pull request Sep 5, 2022
Previously, if the server has a tablespace and
its path has PGDATA's path, the restore
fails because mkdirs.sh doesn't work.

For example, the following case fails to restore.

* PGDATA path: /tmp/pgdata
* tablespace path: /tmp/pgdata_tblspc

So, this patch fixes the case. The root cause
is the logic checking whether the file taking backup
is in tablespace or PGDATA.

Because it only considers their prefix, if the prefix
path of tablespace is the same as PGDATA, it decides
the file is in PGDATA.

So, this patch changes the logic to check it has '/'
after the prefix.
huangfumingyue pushed a commit to huangfumingyue/pg_rman that referenced this pull request Sep 8, 2022
Previously, if the server has a tablespace and
its path has PGDATA's path, the restore
fails because mkdirs.sh doesn't work.

For example, the following case fails to restore.

* PGDATA path: /tmp/pgdata
* tablespace path: /tmp/pgdata_tblspc

So, this patch fixes the case. The root cause
is the logic checking whether the file taking backup
is in tablespace or PGDATA.

Because it only considers their prefix, if the prefix
path of tablespace is the same as PGDATA, it decides
the file is in PGDATA.

So, this patch changes the logic to check it has '/'
after the prefix.
huangfumingyue added a commit that referenced this pull request Sep 8, 2022
…L_10_STABLE (#233)

* Fix the fail if a tablespace path has PGDATA(#141) (#210)

Previously, if the server has a tablespace and
its path has PGDATA's path, the restore
fails because mkdirs.sh doesn't work.

For example, the following case fails to restore.

* PGDATA path: /tmp/pgdata
* tablespace path: /tmp/pgdata_tblspc

So, this patch fixes the case. The root cause
is the logic checking whether the file taking backup
is in tablespace or PGDATA.

Because it only considers their prefix, if the prefix
path of tablespace is the same as PGDATA, it decides
the file is in PGDATA.

So, this patch changes the logic to check it has '/'
after the prefix.

* add start function

Co-authored-by: mikecaat <35882227+mikecaat@users.noreply.github.com>
Co-authored-by: huangfumingyue <mingyue.huangfu.ma@hco.ntt.co.jp>
huangfumingyue added a commit that referenced this pull request Sep 8, 2022
…L_10_STABLE (#233)

* Fix the fail if a tablespace path has PGDATA(#141) (#210)

Previously, if the server has a tablespace and
its path has PGDATA's path, the restore
fails because mkdirs.sh doesn't work.

For example, the following case fails to restore.

* PGDATA path: /tmp/pgdata
* tablespace path: /tmp/pgdata_tblspc

So, this patch fixes the case. The root cause
is the logic checking whether the file taking backup
is in tablespace or PGDATA.

Because it only considers their prefix, if the prefix
path of tablespace is the same as PGDATA, it decides
the file is in PGDATA.

So, this patch changes the logic to check it has '/'
after the prefix.

* add start function

Co-authored-by: mikecaat <35882227+mikecaat@users.noreply.github.com>
Co-authored-by: huangfumingyue <mingyue.huangfu.ma@hco.ntt.co.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants