@@ -984,10 +984,10 @@ LruDelete(File file)
984
984
if (vfdP -> fileFlags & PG_COMPRESSION )
985
985
{
986
986
if (cfs_munmap (vfdP -> map ))
987
- elog (ERROR , "could not unmap file \"%s.cfm\": %m" , vfdP -> fileName );
987
+ elog (ERROR , "CFS: could not unmap file \"%s.cfm\": %m" , vfdP -> fileName );
988
988
989
989
if (close (vfdP -> md ))
990
- elog (ERROR , "could not close map file \"%s.cfm\": %m" , vfdP -> fileName );
990
+ elog (ERROR , "CFS: could not close map file \"%s.cfm\": %m" , vfdP -> fileName );
991
991
992
992
vfdP -> md = VFD_CLOSED ;
993
993
nfile -= 2 ;
@@ -1075,13 +1075,13 @@ LruInsert(File file)
1075
1075
pfree (mapFileName );
1076
1076
if (vfdP -> md < 0 )
1077
1077
{
1078
- elog (LOG , "RE_OPEN MAP FAILED : %d" , errno );
1078
+ elog (LOG , "CFS: reopen map failed : %d" , errno );
1079
1079
return -1 ;
1080
1080
}
1081
1081
vfdP -> map = cfs_mmap (vfdP -> md );
1082
1082
if (vfdP -> map == MAP_FAILED )
1083
1083
{
1084
- elog (LOG , "RE_MAP FAILED : %d" , errno );
1084
+ elog (LOG , "CFS: remap failed : %d" , errno );
1085
1085
close (vfdP -> md );
1086
1086
return -1 ;
1087
1087
}
@@ -1093,7 +1093,7 @@ LruInsert(File file)
1093
1093
vfdP -> fileMode );
1094
1094
if (vfdP -> fd < 0 )
1095
1095
{
1096
- DO_DB (elog (LOG , "re-open failed: %m" ));
1096
+ DO_DB (elog (LOG , "CFS: reopen failed: %m" ));
1097
1097
cfs_munmap (vfdP -> map );
1098
1098
close (vfdP -> md );
1099
1099
vfdP -> md = VFD_CLOSED ;
@@ -1347,26 +1347,31 @@ PathNameOpenFile(FileName fileName, int fileFlags, int fileMode)
1347
1347
if (vfdP -> md < 0 )
1348
1348
{
1349
1349
save_errno = errno ;
1350
- elog (LOG , "RE_OPEN MAP FAILED : %d" , errno );
1350
+ elog (LOG , "CFS: open map failed : %d" , errno );
1351
1351
goto io_error ;
1352
1352
}
1353
1353
vfdP -> map = cfs_mmap (vfdP -> md );
1354
1354
if (vfdP -> map == MAP_FAILED )
1355
1355
{
1356
1356
save_errno = errno ;
1357
- elog (LOG , "RE_MAP FAILED : %d" , errno );
1357
+ elog (LOG , "CFS: map failed : %d" , errno );
1358
1358
close (vfdP -> md );
1359
1359
goto io_error ;
1360
1360
}
1361
1361
/* We need to copy generation before openning data file */
1362
1362
vfdP -> generation = vfdP -> map -> generation ;
1363
1363
pg_read_barrier ();
1364
1364
1365
+ if (InRecovery )
1366
+ {
1367
+ cfs_recover_map (vfdP -> map );
1368
+ }
1369
+
1365
1370
vfdP -> fd = BasicOpenFile (fileName , fileFlags , fileMode );
1366
1371
if (vfdP -> fd < 0 )
1367
1372
{
1368
1373
save_errno = errno ;
1369
- DO_DB (elog (LOG , "re- open failed: %m" ));
1374
+ DO_DB (elog (LOG , "CFS: open failed: %m" ));
1370
1375
cfs_munmap (vfdP -> map );
1371
1376
close (vfdP -> md );
1372
1377
vfdP -> md = VFD_CLOSED ;
@@ -1562,10 +1567,10 @@ FileClose(File file)
1562
1567
if (vfdP -> fileFlags & PG_COMPRESSION )
1563
1568
{
1564
1569
if (cfs_munmap (vfdP -> map ))
1565
- elog (ERROR , "could not unmap file \"%s.cfm\": %m" , vfdP -> fileName );
1570
+ elog (ERROR , "CFS: could not unmap file \"%s.cfm\": %m" , vfdP -> fileName );
1566
1571
1567
1572
if (close (vfdP -> md ))
1568
- elog (ERROR , "could not close map file \"%s.cfm\": %m" , vfdP -> fileName );
1573
+ elog (ERROR , "CFS: could not close map file \"%s.cfm\": %m" , vfdP -> fileName );
1569
1574
vfdP -> md = VFD_CLOSED ;
1570
1575
-- nfile ;
1571
1576
}
@@ -1610,7 +1615,7 @@ FileClose(File file)
1610
1615
if (vfdP -> fileFlags & PG_COMPRESSION ) {
1611
1616
char * mapFileName = psprintf ("%s.cfm" , vfdP -> fileName );
1612
1617
if (unlink (mapFileName ))
1613
- elog (LOG , "could not unlink file \"%s\": %m" , mapFileName );
1618
+ elog (LOG , "CFS: could not unlink file \"%s\": %m" , mapFileName );
1614
1619
pfree (mapFileName );
1615
1620
}
1616
1621
@@ -1976,7 +1981,7 @@ FileWrite(File file, char *buffer, int amount)
1976
1981
*/
1977
1982
pos = cfs_alloc_page (map , CFS_INODE_SIZE (inode ), compressedSize );
1978
1983
if (pos > pos + compressedSize ) {
1979
- elog (ERROR , "CFS segment file exceeed 4Gb limit" );
1984
+ elog (ERROR , "CFS: segment file exceeed 4Gb limit" );
1980
1985
}
1981
1986
1982
1987
inode = CFS_INODE (compressedSize , pos );
@@ -2037,7 +2042,7 @@ FileWrite(File file, char *buffer, int amount)
2037
2042
}
2038
2043
else
2039
2044
{
2040
- elog (LOG , "Write to file %s block %u position %u size %u failed with code %d: %m" ,
2045
+ elog (LOG , "CFS: write to file %s block %u position %u size %u failed with code %d: %m" ,
2041
2046
VfdCache [file ].fileName , (uint32 )(VfdCache [file ].seekPos / BLCKSZ ),
2042
2047
(uint32 )seekPos , amount , returnCode );
2043
2048
returnCode = 0 ;
0 commit comments