If a record did not fit in the current per-CPU log buffer,
pmclog_reserve() queued that buffer and returned the base of a fresh
buffer. It did not move plb_ptr past the record. The next record on
that CPU got the same space and overwrote the first one. If no record
came next, the buffer looked empty, and a flush or a close skipped it.
In both cases, the log lost one record and no drop counter changed.
Move plb_ptr past the record in the fresh buffer, as the path for a
buffer with space does.
The test records_span_buffers writes user records on one CPU through
three buffers. Without this change, it loses the first record of each
new buffer. Before the test stops the log, it waits until the file
holds all the records. A log stop can discard queued buffers, and
D60186 fixes that problem separately.
Sponsored by: AMD