close
Skip to content

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

Merged
mmodzelewski merged 2 commits into
masterfrom
stm-response
Mar 5, 2026
Merged

feat(metadata): thread STM response into consensus Reply body#2856
mmodzelewski merged 2 commits into
masterfrom
stm-response

Conversation

@hubcio
Copy link
Copy Markdown
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.

@hubcio hubcio marked this pull request as ready for review March 3, 2026 11:06
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 3, 2026

Codecov Report

❌ Patch coverage is 5.06329% with 150 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.32%. Comparing base (f6c4150) to head (432899f).
⚠️ Report is 1 commits behind head on master.

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/shard/src/router.rs 0.00% 10 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 ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2856      +/-   ##
============================================
- Coverage     68.36%   68.32%   -0.04%     
  Complexity      739      739              
============================================
  Files          1052     1052              
  Lines         84676    84742      +66     
  Branches      61214    61289      +75     
============================================
+ Hits          57887    57899      +12     
- Misses        24415    24465      +50     
- Partials       2374     2378       +4     
Flag Coverage Δ
csharp 67.43% <ø> (-0.19%) ⬇️
go 6.27% <ø> (ø)
java 54.83% <ø> (ø)
node 92.26% <ø> (-0.04%) ⬇️
python 81.57% <ø> (ø)
rust 70.01% <5.06%> (-0.06%) ⬇️

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 16.03% <0.00%> (-0.51%) ⬇️
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/shard/src/router.rs 0.00% <0.00%> (ø)
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 13 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.

numinnex
numinnex previously approved these changes Mar 4, 2026
@numinnex numinnex requested review from mmodzelewski and spetz March 4, 2026 17:48
mmodzelewski
mmodzelewski previously approved these changes Mar 4, 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.
@hubcio hubcio dismissed stale reviews from mmodzelewski and numinnex via d023973 March 5, 2026 08:57
@mmodzelewski mmodzelewski merged commit 553123e into master Mar 5, 2026
74 checks passed
@mmodzelewski mmodzelewski deleted the stm-response branch March 5, 2026 09:30
kriti-sc pushed a commit to kriti-sc/iggy that referenced this pull request Mar 6, 2026
…#2856)

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.
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.

4 participants