Skip to content

[Rust] Track mock server acks per-stream instead of per-table#186

Draft
danilonajkov-db wants to merge 1 commit intomainfrom
per-stream-mock
Draft

[Rust] Track mock server acks per-stream instead of per-table#186
danilonajkov-db wants to merge 1 commit intomainfrom
per-stream-mock

Conversation

@danilonajkov-db
Copy link
Copy Markdown
Contributor

What changes are proposed in this pull request?

The gRPC mock server previously keyed responses and response indices by table_name, meaning all connections to
the same table shared ack state. In the real server, acks are per-stream — each connection gets its own
independent stream with its own responses.

I need this for multiplexing stream testing.

Changes

mock_grpc.rs

  • Responses now keyed by (table_name, stream_id) instead of just table_name
  • inject_responses auto-splits at CreateStream boundaries so each stream gets its own response list
  • Per-table stream_order queue tracks which stream a new connection should use
  • Errors before any CreateStream become per-connection creation errors
  • Tests that don't specify CreateStream get a default auto-generated stream
  • Same inject_responses(TABLE_NAME, vec![...]) API — no test changes needed

rust_tests.rs

  • Updated test_recovery_after_server_unresponsiveness assertion: the "unresponsive" stream now correctly has no
    ack responses (previously it accidentally acked due to a CreateStream being silently consumed as a no-op
    during record processing)

How is this tested?

existing tests

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.

1 participant