-
Notifications
You must be signed in to change notification settings - Fork 77
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
Invalid path in mkdirs.sh #141
Comments
Dear @ksiddi01 Could you share the method of reproduction? Best regards. |
Hi, We could reproduce the above situation. The root cause seems to be that the logic to check whether the tablespace or $PGDATA is wrong. @ksiddi01
The following is the reproduction way.
Regards, |
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.
Thanks. |
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.
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.
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.
…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 <[email protected]> Co-authored-by: huangfumingyue <[email protected]>
…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 <[email protected]> Co-authored-by: huangfumingyue <[email protected]>
pg_rman restore is failing due to incomplete path in mkdirs.sh file.
Invalid paths:
mkdir -m 700 -p ts
mkdir -m 700 -p ts/PG_10_201707211
mkdir -m 700 -p ts/PG_10_201707211/16395
mkdir -m 700 -p ts/PG_11_201809051
mkdir -m 700 -p ts/PG_11_201809051/16402
Corrected paths:
mkdir -m 700 -p /pgsql/data/ilmrep1p_ts
mkdir -m 700 -p /pgsql/data/ilmrep1p_ts/PG_10_201707211
mkdir -m 700 -p /pgsql/data/ilmrep1p_ts/PG_10_201707211/16395
mkdir -m 700 -p /pgsql/data/ilmrep1p_ts/PG_11_201809051
mkdir -m 700 -p /pgsql/data/ilmrep1p_ts/PG_11_201809051/16402
After mkdirs.sh is modified, restore works properly. Is it because of "_" in folder name (ilmrep1p_ts) ?
mkdirs.sh.txt
The text was updated successfully, but these errors were encountered: