fix: tolerate incomplete query traces in ShardAwarenessTest - #1000
Conversation
QueryTrace.doFetchTrace() retries only until the coordinator's session row reports a duration; the events fetched alongside it can still be empty. The test read that as "the coordinator never queried locally" and failed, which reddened the driver matrix on roughly a quarter of runs. Retry the traced read up to 3 times, binding a fresh statement each attempt, and fail only when no attempt observes a local read. A wrong shard still fails immediately. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: QUIET Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
📝 WalkthroughWalkthrough
Possibly related issues
Possibly related PRs
Mergeability Score: ⚪ Minimal · up to This PR makes the shard-awareness test retry incomplete traces while preserving immediate failure for wrong-shard results. No actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
correctShardInTracingTestfails on ~27% ofjava-driver-matrix-testbuilds (master apache#2083, apache#2085, apache#2091; 2026.3 #4), always with:QueryTrace.doFetchTrace()retries only until the coordinator's session row reports a duration, then freezes whatever the concurrently-issued events query returned — its own comment notes the trace "may not contain the log of replicas". SogetEvents()can return an empty list, which the test read as "the coordinator never queried locally".Retry the traced read up to 3 times, binding a fresh statement per attempt (reusing one would pin the coordinator via the paging optimization), and fail only when no attempt observes a local read. Re-executing is required: once fetched, a trace's events are cached. A wrong shard still fails immediately, without retrying.
Verified against 3-node Scylla 2026.1: 10/10 runs pass, one of which hit the real fault and recovered —
pk=100002is the shard-1 key that fails in CI. Sabotaging the matcher so nothing can match still yieldsBUILD FAILUREafter 3 attempts.🤖 Generated with Claude Code