Open DrewKimball opened 8 months ago
Hi @mgartner, please add branch-* labels to identify which branch(es) this GA-blocker affects.
:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.
@DrewKimball and I discussed this in person. I think where we ended up was that:
Drew, correct me if I'm wrong, or feel free to add some more details.
I'm leaning toward keeping the current behavior by default, and adding a setting that will cause notices to buffer.
@DrewKimball we're not going to add the setting you suggest in 24.1, correct? If so, let's move to 24.2 or backlog.
When a PL/pgSQL RAISE statement is executed, its message is immediately flushed to the client in order to mirror postgres behavior. However, this interferes with transaction retries, because the transaction can no longer be automatically retried once results have been flushed to the client. This is demonstrated by this test:
We probably don't want to start buffering notices until the client connection is closed, since that changes the behavior of RAISE statements and makes them less useful. We could avoid updating
flushInfo.lastFlushed
for notices, and that would allow retries again. However, that would mean that the client would see messages from the old, restarted transactions. Another possibility is to offer a setting that would change the behavior to buffering.Notably, this limitation applies to read committed retries as well as serializable.
Jira issue: CRDB-36215