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

Commit dd77f55

Browse files
committed
Replace LOG with WARNING for CFS IO errors
1 parent a18bc40 commit dd77f55

File tree

1 file changed

+28
-28
lines changed
  • src/backend/storage/file

1 file changed

+28
-28
lines changed

src/backend/storage/file/cfs.c

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ void cfs_lock_file(FileMap* map, char const* file_path)
591591
{
592592
/* Recover map. */
593593
if (!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

596596
close(md2);
597597
}
@@ -681,15 +681,15 @@ static bool cfs_gc_file(char* map_path, bool noerror)
681681
if (md < 0)
682682
{
683683
if (!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
}
686686
goto FinishGC;
687687
}
688688

689689
map = cfs_mmap(md);
690690
if (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);
693693
close(md);
694694
goto FinishGC;
695695
}
@@ -751,7 +751,7 @@ static bool cfs_gc_file(char* map_path, bool noerror)
751751
/* Recover map */
752752
if (!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);
755755
goto Cleanup;
756756
}
757757
close(md2);
@@ -823,14 +823,14 @@ static bool cfs_gc_file(char* map_path, bool noerror)
823823

824824
if (!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",
827827
i, file_path, offs, size);
828828
goto Cleanup;
829829
}
830830

831831
if (!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);
834834
goto Cleanup;
835835
}
836836
cfs_state->gc_stat.processedBytes += size;
@@ -844,38 +844,38 @@ static bool cfs_gc_file(char* map_path, bool noerror)
844844

845845
if (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);
848848
goto Cleanup;
849849
}
850850
fd = -1;
851851

852852
/* Persist copy of data file */
853853
if (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);
856856
goto Cleanup;
857857
}
858858
if (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);
861861
goto Cleanup;
862862
}
863863
fd2 = -1;
864864

865865
/* Persist copy of map file */
866866
if (!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);
869869
goto Cleanup;
870870
}
871871
if (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);
874874
goto Cleanup;
875875
}
876876
if (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);
879879
goto Cleanup;
880880
}
881881
md2 = -1;
@@ -886,12 +886,12 @@ static bool cfs_gc_file(char* map_path, bool noerror)
886886
*/
887887
if (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);
890890
goto Cleanup;
891891
}
892892
if (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);
895895
goto Cleanup;
896896
}
897897

@@ -937,7 +937,7 @@ static bool cfs_gc_file(char* map_path, bool noerror)
937937
remove_backups = false;
938938
if (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);
941941
goto Cleanup;
942942
}
943943

@@ -956,12 +956,12 @@ static bool cfs_gc_file(char* map_path, bool noerror)
956956
* we need to flush updated map file */
957957
if (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);
960960
goto Cleanup;
961961
}
962962
if (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

966966
Cleanup:
967967
if (fd >= 0) close(fd);
@@ -983,7 +983,7 @@ static bool cfs_gc_file(char* map_path, bool noerror)
983983
/* remove map backup file */
984984
if (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);
987987
succeed = false;
988988
}
989989

@@ -992,7 +992,7 @@ static bool cfs_gc_file(char* map_path, bool noerror)
992992

993993
if (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",
996996
MyProcPid, file_path, physSize, newSize, virtSize, usedSize, (double)virtSize/newSize,
997997
secs*USECS_PER_SEC + usecs);
998998
}
@@ -1013,17 +1013,17 @@ static bool cfs_gc_file(char* map_path, bool noerror)
10131013
}
10141014
}
10151015
else 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",
10171017
MyProcPid, suf, map_path, physSize, virtSize, usedSize, (double)virtSize/physSize);
10181018

10191019
if (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);
10221022
succeed = false;
10231023
}
10241024
if (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);
10271027
succeed = false;
10281028
}
10291029

@@ -1316,7 +1316,7 @@ Datum cfs_compression_ratio(PG_FUNCTION_ARGS)
13161316
map = cfs_mmap(md);
13171317
if (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);
13201320
close(md);
13211321
break;
13221322
}
@@ -1325,9 +1325,9 @@ Datum cfs_compression_ratio(PG_FUNCTION_ARGS)
13251325
physSize += pg_atomic_read_u32(&map->physSize);
13261326

13271327
if (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);
13291329
if (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

13321332
i += 1;
13331333
}
@@ -1368,17 +1368,17 @@ Datum cfs_fragmentation(PG_FUNCTION_ARGS)
13681368
map = cfs_mmap(md);
13691369
if (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);
13721372
close(md);
13731373
break;
13741374
}
13751375
usedSize += pg_atomic_read_u32(&map->usedSize);
13761376
physSize += pg_atomic_read_u32(&map->physSize);
13771377

13781378
if (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);
13801380
if (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

13831383
i += 1;
13841384
}

0 commit comments

Comments
 (0)