File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -1200,7 +1200,6 @@ static bool cfs_gc_file(char* map_path, GC_CALL_KIND background)
1200
1200
memcpy (map -> inodes , newMap -> inodes , n_pages * sizeof (inode_t ));
1201
1201
pg_atomic_write_u32 (& map -> hdr .usedSize , newUsed );
1202
1202
pg_atomic_write_u32 (& map -> hdr .physSize , newSize );
1203
- pg_atomic_write_u32 (& map -> gc_active , false);
1204
1203
map -> generation += 1 ; /* force all backends to reopen the file */
1205
1204
1206
1205
/* Before removing backup files and releasing locks
@@ -1210,6 +1209,14 @@ static bool cfs_gc_file(char* map_path, GC_CALL_KIND background)
1210
1209
elog (WARNING , "CFS failed to sync map %s: %m" , map_path );
1211
1210
goto Cleanup ;
1212
1211
}
1212
+ /* now we can safely set gc completion */
1213
+ pg_atomic_write_u32 (& map -> gc_active , false);
1214
+ /* and need to sync it again */
1215
+ if (cfs_msync (map ) < 0 )
1216
+ {
1217
+ elog (WARNING , "CFS failed to sync map %s: %m" , map_path );
1218
+ goto Cleanup ;
1219
+ }
1213
1220
if (pg_fsync (md ) < 0 )
1214
1221
{
1215
1222
elog (WARNING , "CFS failed to sync file %s: %m" , map_path );
You can’t perform that action at this time.
0 commit comments