feat(server): Implement tagged chunk loading#7070
Conversation
afce4b9 to
7a1d609
Compare
b0a1338 to
5d2fb32
Compare
|
augment review |
This comment was marked as outdated.
This comment was marked as outdated.
98a4f93 to
f7e973b
Compare
b885e93 to
54114b7
Compare
c7efb29 to
801814a
Compare
|
@abhijat is it possible to catch in rdb_test.cc ? |
| .key = std::move(key), | ||
| .db_index = cur_db_index_, | ||
| .type = type, | ||
| .pending_read = pending_read_, |
There was a problem hiding this comment.
Saving StreamState copies pending_read_ (which can include large partially-filled buffers like SBF filter_data), causing an extra full-buffer copy and memory spike exactly on chunk boundaries. Prefer moving pending_read_ into StreamState (and then resetting pending_read_) to avoid duplicating potentially huge data.
| .pending_read = pending_read_, | |
| .pending_read = std::move(pending_read_), |
yes I am trying to update the test to cover this |
027fd14 to
336180e
Compare
I added in existing
with the old code it fails with ie key, f1=v1 and f2=v2 created on db=1 which was active when last chunk was received, and not db=0, which was supposed to hold the object with the changes it passes |
Signed-off-by: Abhijat Malviya <abhijat@dragonflydb.io>
Signed-off-by: Abhijat Malviya <abhijat@dragonflydb.io>
Signed-off-by: Abhijat Malviya <abhijat@dragonflydb.io>
336180e to
5f1e22a
Compare
Changes to rdb loader to handle tagged chunks. A data stream read by the loader now looks like:
If the sender does not turn on tagging, then all the data is untagged.
where
Code changes:
RDB_OPCODE_TAGGED_CHUNKand track the active chunk payload budgetNew state in loader:
Some of the new tests can be removed once the saver PR is merged as they will become redundant. But for now these are necessary to test the loader code in isolation by feeding it artificial byte stream containing chunks.
Example of loading one set split across multiple tagged chunks
LoadKeyValPair -> ReadAndDispatchObject -> ReadObj -> ReadSetnow_chunked_stream_states_LoadValueChunk -> ReadAndDispatchObject -> ReadObj -> ReadSetstream_states_now_chunked_