Skip to content

Commit 7ed8014

Browse files
committed
Bug fix. Fix incorrect behaviour of parse_backup_filelist_filenames(), we should use strlen()
1 parent 7fa00e7 commit 7ed8014

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/backup.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2206,7 +2206,8 @@ parse_backup_filelist_filenames(parray *files, const char *root)
22062206

22072207
/* Yes, it is */
22082208
if (sscanf_result == 2 &&
2209-
strcmp(tmp_rel_path, TABLESPACE_VERSION_DIRECTORY) == 0)
2209+
strncmp(tmp_rel_path, TABLESPACE_VERSION_DIRECTORY,
2210+
strlen(TABLESPACE_VERSION_DIRECTORY)) == 0)
22102211
set_cfs_datafiles(files, root, relative, i);
22112212
}
22122213
}

tests/cfs_restore.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def test_restore_empty_tablespace_from_fullbackup(self):
9393
)
9494

9595
try:
96-
self.node.start()
96+
self.node.slow_start()
9797
except ProbackupException as e:
9898
self.fail(
9999
"ERROR: Instance not started after restore. \n {0} \n {1}".format(
@@ -151,7 +151,7 @@ def test_restore_from_fullbackup_to_old_location(self):
151151
"ERROR: File pg_compression not found in tablespace dir"
152152
)
153153
try:
154-
self.node.start()
154+
self.node.slow_start()
155155
except ProbackupException as e:
156156
self.fail(
157157
"ERROR: Instance not started after restore. \n {0} \n {1}".format(
@@ -189,7 +189,7 @@ def test_restore_from_fullbackup_to_old_location_3_jobs(self):
189189
"ERROR: File pg_compression not found in backup dir"
190190
)
191191
try:
192-
self.node.start()
192+
self.node.slow_start()
193193
except ProbackupException as e:
194194
self.fail(
195195
"ERROR: Instance not started after restore. \n {0} \n {1}".format(
@@ -230,7 +230,7 @@ def test_restore_from_fullbackup_to_new_location(self):
230230
"ERROR: File pg_compression not found in backup dir"
231231
)
232232
try:
233-
self.node_new.start()
233+
self.node_new.slow_start()
234234
except ProbackupException as e:
235235
self.fail(
236236
"ERROR: Instance not started after restore. \n {0} \n {1}".format(
@@ -272,7 +272,7 @@ def test_restore_from_fullbackup_to_new_location_5_jobs(self):
272272
"ERROR: File pg_compression not found in backup dir"
273273
)
274274
try:
275-
self.node_new.start()
275+
self.node_new.slow_start()
276276
except ProbackupException as e:
277277
self.fail(
278278
"ERROR: Instance not started after restore. \n {0} \n {1}".format(
@@ -319,7 +319,7 @@ def test_restore_from_fullbackup_to_old_location_tablespace_new_location(self):
319319
"ERROR: File pg_compression not found in new tablespace location"
320320
)
321321
try:
322-
self.node.start()
322+
self.node.slow_start()
323323
except ProbackupException as e:
324324
self.fail(
325325
"ERROR: Instance not started after restore. \n {0} \n {1}".format(
@@ -365,7 +365,7 @@ def test_restore_from_fullbackup_to_old_location_tablespace_new_location_3_jobs(
365365
"ERROR: File pg_compression not found in new tablespace location"
366366
)
367367
try:
368-
self.node.start()
368+
self.node.slow_start()
369369
except ProbackupException as e:
370370
self.fail(
371371
"ERROR: Instance not started after restore. \n {0} \n {1}".format(

0 commit comments

Comments
 (0)