← Back to Pull requests

[#34944] YSQL: Fix flaky TestPgListenNotify#testListenNotifyWithDbClone on sanitizer builds #39078

Merged
dhruva4869 merged 1 files (10 lines) on Nov 24, 2026 06:53 UTC
View on GitHub
dhruva4869 dhruva4869 commented on Nov 24, 2026 03:33 UTC
Author

Summary

TestPgListenNotify#testListenNotifyWithDbClone fails on ASAN builds in 5 of 21 runs (#34944). The clone's CREATE DATABASE ... TEMPLATE yugabyte fails with Cannot allocate a new object identifier: The OID cache invalidation count is unavailable because this TServer does not hold a current xCluster-guarded information lease; retry later.

TestPgListenNotify set xcluster_guarded_lease_duration_ms to 5 s for the whole class, although only testSlotCleanupOnTServerDecommission needs it: remove_tablet_server waits until the master marks the killed TServer as definitely holding no lease, a full lease duration after its last heartbeat. In testListenNotifyWithDbClone, the snapshot schedule makes the master leader flush the sys catalog, which took 5.04 s on an ASAN build, and no TServer renewed its lease meanwhile. In a failed CI run, all three TServers lost the lease together 4.7 s into that flush, and the clone's OID allocation was refused.

The short lease now applies only to testSlotCleanupOnTServerDecommission, which restarts its cluster with it; the test already recreates the cluster afterwards. Every other test in the class gets the default 2-minute lease.

Closes #34944

Test plan

  • TestPgListenNotify#testListenNotifyWithDbClone and TestPgListenNotify#testSlotCleanupOnTServerDecommission on a debug build.

  • TestPgListenNotify#testListenNotifyWithDbClone in this PR's ASAN CI job.
  • ./yb_build.sh debug --java-test 'org.yb.pgsql.TestPgListenNotify#testListenNotifyWithDbClone'
    ./yb_build.sh debug --java-test 'org.yb.pgsql.TestPgListenNotify#testSlotCleanupOnTServerDecommission'
    ./yb_build.sh asan --java-test 'org.yb.pgsql.TestPgListenNotify#testListenNotifyWithDbClone'
    

    🤖 Generated with Claude Code

    Diff: 10 lines (+8 / -2) across 1 files Reviewer: arpang Review duration: 200m
    All Vouch review confidence checks passed
    Residual risk 0.02 = Change Risk (0.17) × (1 − Review Confidence (0.91)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.17 · 10 lines diff across 1 files
    0.17
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.91 · 4 substantive comment(s)
    0.91
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    91%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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.143
    Real PR Conversation Timeline
    7 items
    yugabyte-ci yugabyte-ci commented on Nov 24, 2026 03:33 UTC
    Contributor

    <!-- Reviewable:start -->
    This change is <img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>
    <!-- Reviewable:end -->

    github-actions[bot] github-actions[bot] commented on Nov 24, 2026 03:33 UTC
    Bot

    [![YB](../blob/master/managed/ui/src/redesign/assets/yb_logo.svg?raw=true) CSIweb for PR #39078](https://csiweb.dev.yugabyte.com/pull/39078)

    yb-agentk-dev[bot] yb-agentk-dev[bot] commented on Nov 24, 2026 03:34 UTC
    Bot

    AgentK has started reviewing this pull request — findings will be posted here shortly.

    Pushes are not reviewed automatically. Comment /agentk review to ask for another pass — but please only after substantial changes, not on every small push, and not for a push that just addresses the review comments.

    yb-agentk-dev[bot] yb-agentk-dev[bot] commented on code on Nov 24, 2026 03:37 UTC
    Code Review
    java/yb-pgsql/src/test/java/org/yb/pgsql/TestPgListenNotify.java:1
    @@ -2296,6 +2294,14 @@ public void testSlotCleanupOnTServerRestart() throws Exception {
       @Test
       public void testSlotCleanupOnTServerDecommission() throws Exception {
         final String channel = "decommission_test";
    +    // Only this test needs the short lease. Set for the whole class, it expires on every TServer

    minor — The description says remove_tablet_server waits for DEFINITELY_NO_LEASE. ts_manager.cc:542-546 rejects the call with InvalidArgument instead. With the default lease and the test's 20 s sleep, removal would fail rather than slow down. This supports keeping the short lease here, so no code change is needed.

    yb-agentk-dev[bot] yb-agentk-dev[bot] commented on Nov 24, 2026 03:37 UTC
    Reviewer

    1 inline comment — 1 minor.

    ---

    <sub>React 👍 or 👎 on each comment above — right or wrong, both train the reviewer, and it is the only signal that says which.</sub>

    <sub><i>Reviewed by Golum 1.0</i></sub>

    arpang arpang approved these changes on Nov 24, 2026 06:37 UTC
    Approved Reviewer

    LGTM
    please:

  • add a closes <GHI number> directive in the pr summary, that will automatically clsoe this issue

  • backport this to branches where this test is flaky.
  • Reviewers
    Assignees
    dhruva4869 dhruva4869
    Labels
    risk: low confidence: 91.3% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 17.3% (LOW) · Higher = larger blast radius
    17.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 91.3% · Lower = rushed or shallow review
    91.3%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 2% · Safe to merge
    2%