@@ -591,7 +591,7 @@ void cfs_lock_file(FileMap* map, char const* file_path)
591591{
592592/* Recover map. */
593593if (!cfs_read_file (md2 ,map ,sizeof (FileMap )))
594- elog (LOG ,"CFS failed to read file %s: %m" ,map_bck_path );
594+ elog (WARNING ,"CFS failed to read file %s: %m" ,map_bck_path );
595595
596596close (md2 );
597597}
@@ -681,15 +681,15 @@ static bool cfs_gc_file(char* map_path, bool noerror)
681681if (md < 0 )
682682{
683683if (!noerror ) {
684- elog (LOG ,"CFS failed to open map file %s: %m" ,map_path );
684+ elog (WARNING ,"CFS failed to open map file %s: %m" ,map_path );
685685}
686686gotoFinishGC ;
687687}
688688
689689map = cfs_mmap (md );
690690if (map == MAP_FAILED )
691691{
692- elog (LOG ,"CFS failed to map file %s: %m" ,map_path );
692+ elog (WARNING ,"CFS failed to map file %s: %m" ,map_path );
693693close (md );
694694gotoFinishGC ;
695695}
@@ -751,7 +751,7 @@ static bool cfs_gc_file(char* map_path, bool noerror)
751751/* Recover map */
752752if (!cfs_read_file (md2 ,newMap ,sizeof (FileMap )))
753753{
754- elog (LOG ,"CFS failed to read file %s: %m" ,map_bck_path );
754+ elog (WARNING ,"CFS failed to read file %s: %m" ,map_bck_path );
755755gotoCleanup ;
756756}
757757close (md2 );
@@ -823,14 +823,14 @@ static bool cfs_gc_file(char* map_path, bool noerror)
823823
824824if (!cfs_read_file (fd ,block ,size ))
825825{
826- elog (LOG ,"CFS GC failed to read block %d of file %s at position %d size %d: %m" ,
826+ elog (WARNING ,"CFS GC failed to read block %d of file %s at position %d size %d: %m" ,
827827i ,file_path ,offs ,size );
828828gotoCleanup ;
829829}
830830
831831if (!cfs_write_file (fd2 ,block ,size ))
832832{
833- elog (LOG ,"CFS failed to write file %s: %m" ,file_bck_path );
833+ elog (WARNING ,"CFS failed to write file %s: %m" ,file_bck_path );
834834gotoCleanup ;
835835}
836836cfs_state -> gc_stat .processedBytes += size ;
@@ -844,38 +844,38 @@ static bool cfs_gc_file(char* map_path, bool noerror)
844844
845845if (close (fd )< 0 )
846846{
847- elog (LOG ,"CFS failed to close file %s: %m" ,file_path );
847+ elog (WARNING ,"CFS failed to close file %s: %m" ,file_path );
848848gotoCleanup ;
849849}
850850fd = -1 ;
851851
852852/* Persist copy of data file */
853853if (pg_fsync (fd2 )< 0 )
854854{
855- elog (LOG ,"CFS failed to sync file %s: %m" ,file_bck_path );
855+ elog (WARNING ,"CFS failed to sync file %s: %m" ,file_bck_path );
856856gotoCleanup ;
857857}
858858if (close (fd2 )< 0 )
859859{
860- elog (LOG ," CFS failed to close file %s: %m" ,file_bck_path );
860+ elog (WARNING ,"CFS failed to close file %s: %m" ,file_bck_path );
861861gotoCleanup ;
862862}
863863fd2 = -1 ;
864864
865865/* Persist copy of map file */
866866if (!cfs_write_file (md2 ,& newMap ,sizeof (newMap )))
867867{
868- elog (LOG ,"CFS failed to write file %s: %m" ,map_bck_path );
868+ elog (WARNING ,"CFS failed to write file %s: %m" ,map_bck_path );
869869gotoCleanup ;
870870}
871871if (pg_fsync (md2 )< 0 )
872872{
873- elog (LOG ,"CFS failed to sync file %s: %m" ,map_bck_path );
873+ elog (WARNING ,"CFS failed to sync file %s: %m" ,map_bck_path );
874874gotoCleanup ;
875875}
876876if (close (md2 )< 0 )
877877{
878- elog (LOG ,"CFS failed to close file %s: %m" ,map_bck_path );
878+ elog (WARNING ,"CFS failed to close file %s: %m" ,map_bck_path );
879879gotoCleanup ;
880880}
881881md2 = -1 ;
@@ -886,12 +886,12 @@ static bool cfs_gc_file(char* map_path, bool noerror)
886886 */
887887if (cfs_msync (map )< 0 )
888888{
889- elog (LOG ,"CFS failed to sync map %s: %m" ,map_path );
889+ elog (WARNING ,"CFS failed to sync map %s: %m" ,map_path );
890890gotoCleanup ;
891891}
892892if (pg_fsync (md )< 0 )
893893{
894- elog (LOG ,"CFS failed to sync file %s: %m" ,map_path );
894+ elog (WARNING ,"CFS failed to sync file %s: %m" ,map_path );
895895gotoCleanup ;
896896}
897897
@@ -937,7 +937,7 @@ static bool cfs_gc_file(char* map_path, bool noerror)
937937remove_backups = false;
938938if (rename (file_bck_path ,file_path )< 0 )
939939{
940- elog (LOG ,"CFS failed to rename file %s: %m" ,file_path );
940+ elog (WARNING ,"CFS failed to rename file %s: %m" ,file_path );
941941gotoCleanup ;
942942}
943943
@@ -956,12 +956,12 @@ static bool cfs_gc_file(char* map_path, bool noerror)
956956 * we need to flush updated map file */
957957if (cfs_msync (map )< 0 )
958958{
959- elog (LOG ,"CFS failed to sync map %s: %m" ,map_path );
959+ elog (WARNING ,"CFS failed to sync map %s: %m" ,map_path );
960960gotoCleanup ;
961961}
962962if (pg_fsync (md )< 0 )
963963{
964- elog (LOG ,"CFS failed to sync file %s: %m" ,map_path );
964+ elog (WARNING ,"CFS failed to sync file %s: %m" ,map_path );
965965
966966Cleanup :
967967if (fd >=0 )close (fd );
@@ -983,7 +983,7 @@ static bool cfs_gc_file(char* map_path, bool noerror)
983983/* remove map backup file */
984984if (remove_backups && unlink (map_bck_path ))
985985{
986- elog (LOG ,"CFS failed to unlink file %s: %m" ,map_bck_path );
986+ elog (WARNING ,"CFS failed to unlink file %s: %m" ,map_bck_path );
987987succeed = false;
988988}
989989
@@ -992,7 +992,7 @@ static bool cfs_gc_file(char* map_path, bool noerror)
992992
993993if (succeed )
994994{
995- elog (LOG ,"%d: defragment file %s: old size %d, new size %d, logical size %d, used %d, compression ratio %f, time %ld usec" ,
995+ elog (LOG ,"CFS GC worker %d: defragment file %s: old size %d, new size %d, logical size %d, used %d, compression ratio %f, time %ld usec" ,
996996MyProcPid ,file_path ,physSize ,newSize ,virtSize ,usedSize , (double )virtSize /newSize ,
997997secs * USECS_PER_SEC + usecs );
998998}
@@ -1013,17 +1013,17 @@ static bool cfs_gc_file(char* map_path, bool noerror)
10131013}
10141014}
10151015else if (cfs_state -> max_iterations == 1 )
1016- elog (LOG ,"%d: file %.*s: physical size %d, logical size %d, used %d, compression ratio %f" ,
1016+ elog (LOG ,"CFS GC worker %d: file %.*s: physical size %d, logical size %d, used %d, compression ratio %f" ,
10171017MyProcPid ,suf ,map_path ,physSize ,virtSize ,usedSize , (double )virtSize /physSize );
10181018
10191019if (cfs_munmap (map )< 0 )
10201020{
1021- elog (LOG ,"CFS failed to unmap file %s: %m" ,map_path );
1021+ elog (WARNING ,"CFS failed to unmap file %s: %m" ,map_path );
10221022succeed = false;
10231023}
10241024if (close (md )< 0 )
10251025{
1026- elog (LOG ,"CFS failed to close file %s: %m" ,map_path );
1026+ elog (WARNING ,"CFS failed to close file %s: %m" ,map_path );
10271027succeed = false;
10281028}
10291029
@@ -1316,7 +1316,7 @@ Datum cfs_compression_ratio(PG_FUNCTION_ARGS)
13161316map = cfs_mmap (md );
13171317if (map == MAP_FAILED )
13181318{
1319- elog (LOG ,"cfs_compression_ration failed to map file %s: %m" ,map_path );
1319+ elog (WARNING ,"CFS compression_ratio failed to map file %s: %m" ,map_path );
13201320close (md );
13211321break ;
13221322}
@@ -1325,9 +1325,9 @@ Datum cfs_compression_ratio(PG_FUNCTION_ARGS)
13251325physSize += pg_atomic_read_u32 (& map -> physSize );
13261326
13271327if (cfs_munmap (map )< 0 )
1328- elog (LOG ,"CFS failed to unmap file %s: %m" ,map_path );
1328+ elog (WARNING ,"CFS failed to unmap file %s: %m" ,map_path );
13291329if (close (md )< 0 )
1330- elog (LOG ,"CFS failed to close file %s: %m" ,map_path );
1330+ elog (WARNING ,"CFS failed to close file %s: %m" ,map_path );
13311331
13321332i += 1 ;
13331333}
@@ -1368,17 +1368,17 @@ Datum cfs_fragmentation(PG_FUNCTION_ARGS)
13681368map = cfs_mmap (md );
13691369if (map == MAP_FAILED )
13701370{
1371- elog (LOG ,"cfs_compression_ration failed to map file %s: %m" ,map_path );
1371+ elog (WARNING ,"CFS compression_ratio failed to map file %s: %m" ,map_path );
13721372close (md );
13731373break ;
13741374}
13751375usedSize += pg_atomic_read_u32 (& map -> usedSize );
13761376physSize += pg_atomic_read_u32 (& map -> physSize );
13771377
13781378if (cfs_munmap (map )< 0 )
1379- elog (LOG ,"CFS failed to unmap file %s: %m" ,map_path );
1379+ elog (WARNING ,"CFS failed to unmap file %s: %m" ,map_path );
13801380if (close (md )< 0 )
1381- elog (LOG ,"CFS failed to close file %s: %m" ,map_path );
1381+ elog (WARNING ,"CFS failed to close file %s: %m" ,map_path );
13821382
13831383i += 1 ;
13841384}