8000 don't elog(DEBUG3) on production build · postgrespro/ptrack@f8a7400 · GitHub
[go: up one dir, main page]

Skip to content

Commit f8a7400

Browse files
committed
don't elog(DEBUG3) on production build
`elog` is surprisingly expective, since it calls `errstart` function
1 parent 2bddc22 commit f8a7400

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ptrack.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,21 +622,25 @@ ptrack_get_pagemapset(PG_FUNCTION_ARGS)
622622

623623
update_lsn1 = pg_atomic_read_u64(&ptrack_map->entries[slot1]);
624624

625+
#if USE_ASSERT_CHECKING
625626
if (update_lsn1 != InvalidXLogRecPtr)
626627
elog(DEBUG3, "ptrack: update_lsn1 %X/%X of blckno %u of file %s",
627628
(uint32) (update_lsn1 >> 32), (uint32) update_lsn1,
628629
ctx->bid.blocknum, ctx->relpath);
630+
#endif
629631

630632
/* Only probe the second slot if the first one is marked */
631633
if (update_lsn1 >= ctx->lsn)
632634
{
633635
slot2 = (size_t)(((hash << 32) | (hash >> 32)) % PtrackContentNblocks);
634636
update_lsn2 = pg_atomic_read_u64(&ptrack_map->entries[slot2]);
635637

638+
#if USE_ASSERT_CHECKING
636639
if (update_lsn2 != InvalidXLogRecPtr)
637640
elog(DEBUG3, "ptrack: update_lsn2 %X/%X of blckno %u of file %s",
638641
(uint32) (update_lsn1 >> 32), (uint32) update_lsn2,
639642
ctx->bid.blocknum, ctx->relpath);
643+
#endif
640644

641645
/* Block has been changed since specified LSN. Mark it in the bitmap */
642646
if (update_lsn2 >= ctx->lsn)

0 commit comments

Comments
 (0)
0