Andres Freund <andres@2ndquadrant.com> writes:
> I played a bit arround (thanks Sergey!) and it seems to be some rather
> strange optimization issue around the fsync request queue.
> Namely changing
> request->rnode = rnode;
> into
> request->rnode.spcNode = rnode.spcNode;
> request->rnode.dbNode = rnode.dbNode;
> request->rnode.relNode = rnode.relNode;
> makes it pass reliably.
Jeez. That's my candidate for weird compiler bug of the month.
> How the hell thats correlating with the elog changes I don't yet know.
There is an elog(ERROR) further up in the same function, but it's sure
not clear how that could cause the compiler to misimplement a struct
assignment. Maybe the problem is not in those lines alone, but the fact
that rnode is a pass-by-value struct? (That is, maybe it's the value of
the rnode local variable that's getting munged, somewhere up near the
elog call?) We tend to not use pass-by-value struct params much, so we
might not have noticed a compiler bug associated with that. Or IOW,
does changing ForwardFsyncRequest to use a "const RelFileNode *rnode"
parameter make it go away?
regards, tom lane