Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d9378f7

Browse files
committed
CFS GC should ignore directories of other instances
1 parent cad66d9 commit d9378f7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/backend/storage/file/cfs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,7 @@ static bool cfs_gc_file(char* map_path, GC_CALL_KIND background)
13611361
* Perform garbage collection on each compressed file
13621362
* in the pg_tblspc directory.
13631363
*/
1364-
static bool cfs_gc_directory(int worker_id, char const* path)
1364+
static bool cfs_gc_directory(int worker_id, char const* path, int depth)
13651365
{
13661366
DIR* dir = AllocateDir(path);
13671367
bool success = true;
@@ -1393,7 +1393,7 @@ static bool cfs_gc_directory(int worker_id, char const* path)
13931393
break;
13941394
}
13951395
}
1396-
else if (!cfs_gc_directory(worker_id, file_path))
1396+
else if ((depth != 1 || strcmp(entry->d_name, TABLESPACE_VERSION_DIRECTORY) == 0) && !cfs_gc_directory(worker_id, file_path, depth+1))
13971397
{
13981398
success = false;
13991399
break;
@@ -1426,7 +1426,7 @@ static void cfs_sighup(SIGNAL_ARGS)
14261426
*/
14271427
static bool cfs_gc_scan_tablespace(int worker_id)
14281428
{
1429-
return cfs_gc_directory(worker_id, "pg_tblspc");
1429+
return cfs_gc_directory(worker_id, "pg_tblspc", 0);
14301430
}
14311431

14321432
static void cfs_gc_bgworker_main(Datum arg)

src/include/storage/cfs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "port/atomics.h"
77
#include "storage/rijndael.h"
88

9-
#define CFS_VERSION "0.47"
9+
#define CFS_VERSION "0.48"
1010

1111
#define CFS_GC_LOCK (MAX_BACKENDS+1)
1212

0 commit comments

Comments
 (0)