Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7c4dcfd

Browse files
authored
Merge pull request#36 from postgrespro/PBCKP-564
[PBCKP-564] Don't spam with "skip empty file" message
2 parents42ea77d +528c9db commit7c4dcfd

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

‎ptrack.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -322,14 +322,22 @@ ptrack_gather_filelist(List **filelist, char *path, Oid spcOid, Oid dbOid)
322322

323323
if (sret<0)
324324
{
325-
ereport(LOG,
325+
ereport(WARNING,
326326
(errcode_for_file_access(),
327327
errmsg("ptrack: could not stat file \"%s\": %m",subpath)));
328328
continue;
329329
}
330330

331331
if (S_ISREG(fst.st_mode))
332332
{
333+
if (fst.st_size==0)
334+
{
335+
elog(DEBUG3,"ptrack: skip empty file %s",subpath);
336+
337+
/* But try the next one */
338+
continue;
339+
}
340+
333341
/* Regular file inside database directory, otherwise skip it */
334342
if (dbOid!=InvalidOid||spcOid==GLOBALTABLESPACE_OID)
335343
{
@@ -406,6 +414,8 @@ ptrack_filelist_getnext(PtScanCtx * ctx)
406414
RelFileNodeBackendrnodebackend;
407415
#endif
408416

417+
get_next:
418+
409419
/* No more file in the list */
410420
if (list_length(ctx->filelist)==0)
411421
return-1;
@@ -440,15 +450,15 @@ ptrack_filelist_getnext(PtScanCtx * ctx)
440450
elog(WARNING,"ptrack: cannot stat file %s",fullpath);
441451

442452
/* But try the next one */
443-
returnptrack_filelist_getnext(ctx);
453+
gotoget_next;
444454
}
445455

446456
if (fst.st_size==0)
447457
{
448-
elog(WARNING,"ptrack: skip empty file %s",fullpath);
458+
elog(DEBUG3,"ptrack: skip empty file %s",fullpath);
449459

450460
/* But try the next one */
451-
returnptrack_filelist_getnext(ctx);
461+
gotoget_next;
452462
}
453463

454464
#ifCFS_SUPPORT
@@ -460,7 +470,7 @@ ptrack_filelist_getnext(PtScanCtx * ctx)
460470

461471
// Could not open fullpath for some reason, trying the next file.
462472
if(rel_st_size==-1)
463-
returnptrack_filelist_getnext(ctx);
473+
gotoget_next;
464474
}else
465475
#endif
466476
rel_st_size=fst.st_size;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp