Skip to content

Conversation

@drmingdrmer
Copy link
Member

@drmingdrmer drmingdrmer commented Oct 23, 2025

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

fix: meta-service: watch stream should be atomically added

It requires a WriterPermit to ensure atomic watch stream
initialization. The permit prevents race conditions where state machine
writes could occur between snapshot reads and watcher registration,
causing event loss.

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)

Related Issues


This change is Reviewable

It requires a `WriterPermit` to ensure atomic watch stream initialization. The permit prevents race conditions where state machine writes could occur between snapshot reads and watcher registration, causing event loss.
@github-actions github-actions bot added the pr-bugfix this PR patches a bug in codebase label Oct 23, 2025
@drmingdrmer drmingdrmer merged commit ebb242f into databendlabs:main Oct 23, 2025
90 checks passed
@drmingdrmer drmingdrmer deleted the 333-race-condition-watch-init branch October 23, 2025 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix this PR patches a bug in codebase

1 participant