Skip to content

Fix split-buffer remap state consistency#76

Merged
dallison merged 3 commits into
mainfrom
cursor/critical-correctness-bugs-3ae7
May 26, 2026
Merged

Fix split-buffer remap state consistency#76
dallison merged 3 commits into
mainfrom
cursor/critical-correctness-bugs-3ae7

Conversation

@cursor

@cursor cursor Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

Bug and impact

  • Placeholder channels remapped by the first publisher replaced their CCB/BCB shared-memory FDs without sending the refreshed descriptors to shadow.
  • A crash after such a remap could make shadow recovery use stale placeholder mappings with updated publisher/client-buffer metadata, risking corrupted recovery or crashes.
  • Split-buffer option validation was asymmetric, allowing a later non-split publisher onto an already split-buffer channel, which could mix incompatible payload layouts.

Root cause

  • Server::RemapChannel only updated local shared-memory FDs and did not replicate a refreshed channel create event to shadow.
  • The remap path also failed to preserve the channel slot size for shadow metadata before any buffer allocation.
  • ValidateOrSetSplitBufferOptions only rejected mismatches when the incoming option was true.

Fix

  • Replicate remapped channel state to shadow with refreshed FDs and slot metadata.
  • Preserve last_known_slot_size during remap.
  • Require exact split-buffer option consistency once channel options are established.
  • Added regression coverage for placeholder remap shadow state and mixed publisher split-buffer options.

Validation

  • /tmp/subspace-tools/bin/bazelisk test //client:client_test --test_filter='ClientTest.RejectsMixedSplitBufferPublisherOptions'
  • /tmp/subspace-tools/bin/bazelisk test //shadow:shadow_test --test_filter='ShadowRecoveryTest.ShadowTracksPlaceholderRemap'
  • /tmp/subspace-tools/bin/bazelisk test //shadow:shadow_test //client:bridge_test
Open in Web View Automation 

cursoragent and others added 3 commits May 22, 2026 11:10
Co-authored-by: dallison <dallison@users.noreply.github.com>
Co-authored-by: dallison <dallison@users.noreply.github.com>
@dallison dallison marked this pull request as ready for review May 26, 2026 22:13
@dallison dallison merged commit 5d0c1a0 into main May 26, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants