Skip to content

feat(metadata): thread STM response into consensus Reply body#2856

Open
hubcio wants to merge 1 commit intomasterfrom
stm-response
Open

feat(metadata): thread STM response into consensus Reply body#2856
hubcio wants to merge 1 commit intomasterfrom
stm-response

Conversation

@hubcio
Copy link
Contributor

@hubcio hubcio commented Mar 3, 2026

After a metadata state machine commit, the Reply message had an empty body -- mux_stm.update() returned () and the result was discarded. Clients need the response (e.g. assigned IDs) to proceed without a second query.

StateHandler::apply now returns Bytes, stored in a last_result field on each *Inner struct during
left_right::Absorb (which forces () return). After publish(), the result is read back through ReadHandle and propagated through State -> StateMachine -> MuxSTM into build_reply_message, which now accepts a body parameter and constructs a variable-length BytesMut buffer instead of a header-only transmute.

All 19 handlers return Bytes::new() for now.

After a metadata state machine commit, the Reply message
had an empty body -- mux_stm.update() returned () and
the result was discarded. Clients need the response
(e.g. assigned IDs) to proceed without a second query.

StateHandler::apply now returns Bytes, stored in a
last_result field on each *Inner struct during
left_right::Absorb (which forces () return). After
publish(), the result is read back through ReadHandle
and propagated through State -> StateMachine -> MuxSTM
into build_reply_message, which now accepts a body
parameter and constructs a variable-length BytesMut
buffer instead of a header-only transmute.

All 19 handlers return Bytes::new() for now.
@hubcio hubcio marked this pull request as ready for review March 3, 2026 11:06
@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

❌ Patch coverage is 5.40541% with 140 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.89%. Comparing base (be23a35) to head (5cb2ffb).

Files with missing lines Patch % Lines
core/metadata/src/stm/stream.rs 10.63% 42 Missing ⚠️
core/consensus/src/plane_helpers.rs 0.00% 30 Missing ⚠️
core/shard/src/lib.rs 0.00% 25 Missing ⚠️
core/metadata/src/stm/user.rs 4.16% 23 Missing ⚠️
core/metadata/src/impls/metadata.rs 0.00% 6 Missing ⚠️
core/metadata/src/stm/consumer_group.rs 14.28% 6 Missing ⚠️
core/metadata/src/stm/mod.rs 0.00% 6 Missing ⚠️
core/partitions/src/iggy_partitions.rs 0.00% 2 Missing ⚠️

❌ Your patch check has failed because the patch coverage (5.40%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2856      +/-   ##
============================================
- Coverage     67.94%   67.89%   -0.06%     
  Complexity      739      739              
============================================
  Files          1049     1049              
  Lines         84385    84443      +58     
  Branches      60963    61032      +69     
============================================
- Hits          57336    57329       -7     
- Misses        24692    24744      +52     
- Partials       2357     2370      +13     
Flag Coverage Δ
csharp 67.43% <ø> (-0.19%) ⬇️
go 6.33% <ø> (ø)
java 54.83% <ø> (ø)
node 92.26% <ø> (-0.15%) ⬇️
python 0.00% <ø> (ø)
rust 70.17% <5.40%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
core/metadata/src/stm/mux.rs 91.35% <100.00%> (ø)
core/partitions/src/iggy_partitions.rs 0.00% <0.00%> (ø)
core/metadata/src/impls/metadata.rs 15.44% <0.00%> (-0.47%) ⬇️
core/metadata/src/stm/consumer_group.rs 18.91% <14.28%> (+0.19%) ⬆️
core/metadata/src/stm/mod.rs 46.75% <0.00%> (-1.25%) ⬇️
core/metadata/src/stm/user.rs 43.05% <4.16%> (-0.88%) ⬇️
core/shard/src/lib.rs 0.00% <0.00%> (ø)
core/consensus/src/plane_helpers.rs 56.56% <0.00%> (-1.05%) ⬇️
core/metadata/src/stm/stream.rs 19.58% <10.63%> (+0.44%) ⬆️

... and 15 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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