[#35212,#35247] YSQL: Always write NOTIFY rows in the statement's transaction #37444
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 226 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.325
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #37444"
general
weight: 0.35
arpang
Summary
Outside a transaction block, the rows for
NOTIFYwere written topg_yb_notificationswith single-shard writes, which commit at once. When the statement had already read a table, the notification's cleanup DELETE ran at that older read time, found the row its own INSERT had just committed, and raisedRestart read required:pg_yb_notifications.ybInsertPendingNotifiesToTablenow always writes in the statement's transaction, so the INSERT/DELETE pair commits with it.TestPgRegressPgAsyncwaits longer for notifications on sanitizer builds: a statement's notifications are queued only once its whole transaction has been streamed, which for the 1000-notification step takes over a second there.Test plan
testNotifyAfterTableReadDeliveredOnce. Without the fix it fails withexpected:<[simple, simple_sentinel]> but was:<[simple, simple, simple_sentinel]>; over the extended protocol the statement fails withRestart read required.TestPgListenNotifypasses.yb_read_timestill rejects writes.Run on a debug build on macOS arm64.
🤖 Generated with Claude Code