> No, I don't think so. This is just about errors on the bufmgr layer.
I see. Looks like I misinterpreted the comment in md.c where it sets
this flag when it reads 0 blocks.
> I apparently may be alone in this, but I find 6 repetitions of ereports, with
> differently indented messages and arguments, depending on whether it's an
> errmsg, errdetails, errhint way harder to scan and modify than something that
> just shows the different messages with consistent indentation.
Is changing the messages to follow the same pattern an option?
For example the error messages:
"read error in block %u of relation \"%s\": %s"
"%u read errors among blocks %u..%u of relation \"%s\": %s"
When the last string is conditional:
* invalid page(s)
* zeroing out invalid page(s)
* ignoring checksum error(s)
or maybe
"read error: %s in block %u of relation \"%s\""
errdetail would use a generic description (first faulty page?)
errhint could stay the same (maybe with errhint_plural?)
And that would simplify the ifs:
if (result.status == PGAIO_RS_ERROR)
{
affected_count = zeroed_or_error_count;
msg_action = affected_count > 1 ? "invalid pages" : "invalid page";
}