Skip to content

fix(disttae): release subscription state locks before diagnostics - #32022

Merged
XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/subscription-log-lock
Nov 2, 2026
Merged

XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/subscription-log-lock

Conversation

@XuPeng-SH

@XuPeng-SH XuPeng-SH commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Fixes #32021

What this PR does / why we need it:

A slow subscription diagnostic sink holds the cross-table subscription state lock and stalls unrelated subscribed-table reads. Move the state owner's response, explicit-unsubscribe and GC-rollback diagnostics after lock release, carrying immutable scalar fields. Remove the common send-success diagnostic, nested cleanup Debug log and mutable subscription-map dump. State transitions, transport sends and cleanup retain their original synchronization and failure semantics.

The removed send-success event is an intentional observability tradeoff: final subscription success remains logged, but it is not a one-to-one replacement for every successful send. Retained transition logs describe the committed event and may appear after a later concurrent transition.

Validation on Go 1.27.1 / macOS arm64:

  • Same deterministic reporter-backpressure regressions on clean main: 13 lock-retention failures and eight passing error/cancellation controls. All 21 scenarios pass after the fix, including a real unrelated-table partition lookup while diagnostics remain blocked, Debug cleanup, retained scalar fields, and actual-only GC rollback logging.
  • Complete owning package on the published head: 629 test roots and 829 subcases passed in normal and race modes, with no skips.
  • Six exact concurrency tests each passed 100 race repetitions, including ready-wait single-send/state preservation and checkpoint isolation/replacement controls.
  • Incremental formatting, repository policy, vet, pinned molint and configured golangci-lint passed for the complete affected package. Actual gpt-6.1-terra/max design and independent overall review passed.

This closes the demonstrated direct diagnostic-lock dependency. Transport-internal logging and I/O retain their existing synchronization; scheduler delays and PR #31944's separate end-to-end P95 acceptance remain unresolved. No production P95 improvement is claimed. CI for this head is pending.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH

XuPeng-SH commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor Author

mo-bot review · mo-bot-local · superseded

Commit: d24c82f9a8b34cddbb949a3529c52a842c3264bc

Review linked issue or PR description changed before publication; a fresh contextual review is queued.

@XuPeng-SH

XuPeng-SH commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor Author

mo-bot review · mo-bot-local · done

Commit: d24c82f9a8b34cddbb949a3529c52a842c3264bc

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: d24c82f9a8b34cddbb949a3529c52a842c3264bc

Assessment: approve

Complete review found no actionable defects. The updated validation statement is supported by retained results; diagnostic lock release preserves state, send, and cleanup semantics.

Model: gpt-6-astra / xhigh

Session: 01a1869d-820c-7212-9788-aecfb86a4141 · slot 0 · generation 2

Validation:

  • Verified identical frozen source, patch, native inputs, and matching command/source/exit receipts before reusing checks.

  • Reused passing normal/race results: 21 focused scenarios and 629 roots plus 829 subcases per full package run, with no skips.

  • Reused 100 passing race repetitions for each new test, plus vet, formatting, and isolation checks.

  • Current audit passed. Review plan, all three discussion dispositions, receipts, and logs are retained in the assigned diagnostic directory.

Limitations:

  • Product tests were reused from verified same-head execution, not rerun.

  • Frozen CI build, UT, coverage, and SCA remain pending; no end-to-end latency improvement is claimed.

This branch was successfully deployed

No deployments
ci — cf812da2 Deployed Nov 2, 2026 by XuPeng-SH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working kind/enhancement kind/refactor Code refactor kind/test-ci size/L Denotes a PR that changes [500,999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: subscription diagnostics hold the shared state lock and stall unrelated reads

2 participants