Fixed reporting action states when restart page appears outdated

If start buffer is more recent than restart, we update committed LSN
with last record LSN of block (last_end_lsn) while applying action but
forget about it while printing records with -f for investigation
purpose.

Note that while applying actions we use start_buffer to calculate
latest page out of block 2 and block 3 and then from latest take
committed LSN. For -f we don't need buffers so we just compare
directly with committed LSN from restart.

(contributed by Rakesh Pandit)
This commit is contained in:
Jean-Pierre André 2015-12-01 11:10:48 +01:00
parent f7cbf30d54
commit ca70766dc4

View File

@ -3720,6 +3720,20 @@ static int walk(CONTEXT *ctx)
}
if (!done) {
buf = nextbuf;
if (blk >= RSTBLKS && blk < BASEBLKS) {
/* The latest buf may be more recent
than restart */
rph = &buf->block.record;
if ((s64)(le64_to_cpu(rph->last_end_lsn)
- committed_lsn) > 0) {
committed_lsn =
le64_to_cpu(rph->last_end_lsn);
if (optv)
printf("* Restart page was "
"obsolete, updated "
"committed lsn\n");
}
}
if (optv)
printf("\n* block %d at 0x%llx\n",(int)blk,
(long long)loclogblk(ctx, blk));