numaflow icon indicating copy to clipboard operation
numaflow copied to clipboard

Encapsulate NackOptions in Box

Open vaibhavtiwari33 opened this issue 5 months ago • 5 comments

Encapsulates MessageHandle, which has nack_options added. I have a todo to wrap nack_options in Box, will take this up as a separate issue.

Originally posted by @vaibhavtiwari33 in https://github.com/numaproj/numaflow/pull/3455#discussion_r3500527296

vaibhavtiwari33 avatar Jun 30 '26 17:06 vaibhavtiwari33

Hi @vaibhavtiwari33, I'd like to work on this. I have a local patch changing Message::nack_options to Option<Box<NackOptions>>.

On aarch64, this reduces Message from 272 to 232 bytes and the relevant Tokio mpsc block from 8,992 to 7,712 bytes.

One nuance: the existing large_enum_variant allow still cannot be removed (SegmentWriteMessage becomes 240 bytes vs. 32 bytes), and removing it would require boxing MessageHandle itself on the WAL write path. I plan to keep that allow and limit the PR to the issue's storage change, conversions, and a pointer-size regression test.

Does that match the intended scope?

roian6 avatar Jul 11 '26 03:07 roian6

Could I be assigned this??am familiar with the code structure since

AyushSrivastava1818 avatar Jul 15 '26 03:07 AyushSrivastava1818

There are some additional changes that I need to make for per-message nack after which will assign this issue accordingly to avoid merge conflicts.

vaibhavtiwari33 avatar Jul 15 '26 14:07 vaibhavtiwari33

@vaibhavtiwari33 Are we ready to implement this??

AyushSrivastava1818 avatar Jul 25 '26 11:07 AyushSrivastava1818

I'd like to take this. I've boxed Message.nack_options to Option<Box> per the TODO in message.rs — callers box on write and deref on read, so Message stays small on the hot path and only pays for nack_options on the rare nack path. Behavior is unchanged and the existing nack tests pass. PR coming.

DoTuanAnh2k1 avatar Aug 01 '26 01:08 DoTuanAnh2k1