File tree Expand file tree Collapse file tree 1 file changed +17
-17
lines changed Expand file tree Collapse file tree 1 file changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -1109,23 +1109,6 @@ static bool cfs_gc_file(char* map_path, GC_CALL_KIND background)
1109
1109
}
1110
1110
md2 = -1 ;
1111
1111
1112
- /*
1113
- * Persist map with gc_active set:
1114
- * in case of crash we will know that map may be changed by GC
1115
- */
1116
- pg_atomic_write_u32 (& map -> gc_active , true); /* Indicate start of GC */
1117
-
1118
- if (cfs_msync (map ) < 0 )
1119
- {
1120
- elog (WARNING , "CFS failed to sync map %s: %m" , map_path );
1121
- goto Cleanup ;
1122
- }
1123
- if (pg_fsync (md ) < 0 )
1124
- {
1125
- elog (WARNING , "CFS failed to sync file %s: %m" , map_path );
1126
- goto Cleanup ;
1127
- }
1128
-
1129
1112
if (cfs_gc_verify_file )
1130
1113
{
1131
1114
fd = open (file_bck_path , O_RDONLY |PG_BINARY , 0 );
@@ -1160,6 +1143,23 @@ static bool cfs_gc_file(char* map_path, GC_CALL_KIND background)
1160
1143
close (fd );
1161
1144
}
1162
1145
1146
+ /*
1147
+ * Persist map with gc_active set:
1148
+ * in case of crash we will know that map may be changed by GC
1149
+ */
1150
+ pg_atomic_write_u32 (& map -> gc_active , true); /* Indicate start of GC */
1151
+
1152
+ if (cfs_msync (map ) < 0 )
1153
+ {
1154
+ elog (WARNING , "CFS failed to sync map %s: %m" , map_path );
1155
+ goto Cleanup ;
1156
+ }
1157
+ if (pg_fsync (md ) < 0 )
1158
+ {
1159
+ elog (WARNING , "CFS failed to sync file %s: %m" , map_path );
1160
+ goto Cleanup ;
1161
+ }
1162
+
1163
1163
/*
1164
1164
* Now all information necessary for recovery is stored.
1165
1165
* We are ready to replace existing file with defragmented one.
You can’t perform that action at this time.
0 commit comments