Skip to content

dbsp: Change threshold for spilling to storage from rows to bytes.#1917

Merged
blp merged 2 commits into
mainfrom
byte-size
Jul 5, 2024
Merged

dbsp: Change threshold for spilling to storage from rows to bytes.#1917
blp merged 2 commits into
mainfrom
byte-size

Conversation

@blp

@blp blp commented Jun 21, 2024

Copy link
Copy Markdown
Member

A row can be any old size but a byte is well-defined.

See issue #1812.

Is this a user-visible change (yes/no): no

@blp
blp requested a review from gz June 21, 2024 21:51
@blp blp added DBSP core Related to the core DBSP library API Distributed system APIs storage Persistence for internal state in DBSP operators rust labels Jun 21, 2024
@blp blp linked an issue Jun 21, 2024 that may be closed by this pull request
Comment thread crates/dbsp/src/trace/mod.rs Outdated

@gz gz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe also needs a Ctrl+F for min_storage_rows in the web-console folder to adjust any reference to it if you havent dont that already

Comment thread crates/dbsp/src/trace/ord/fallback/key_batch.rs Outdated
Comment thread crates/dbsp/src/trace/ord/fallback/key_batch.rs Outdated
Comment thread crates/dbsp/src/trace/ord/fallback/key_batch.rs Outdated
Comment thread crates/adapters/src/controller/mod.rs Outdated
/// This can be an approximation, such as the size of an on-disk file for a
/// stored batch.
///
/// Implementations of this function can be expensive because they might

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not obvious to me why it can't be computed and stored in the meta-data of the Vec* types when building the batch?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be. I just don't see enough benefit. It complicates the merger implementations, which are already hard enough for me to understand (and to have any confidence in those incremental implementations I'd have to write careful tests), and it adds a cost to every builder and merger. it would only have a benefit in a case where we're about to visit every key-value pair anyway (a merge) and in that case we're throwing away the source batches anyway (because the merge consumes them). Also, we know that in-memory source batches are relatively small by the standard of the threshold, because otherwise they wouldn't be in memory.

If this turns out to be a mistake, then it'll show up in a profile. (On the other hand, the cost of incrementally maintaining the size won't ever show up in a profile because it'll be hidden inside larger code.)

A row can be any old size but a byte is well-defined.

Signed-off-by: Ben Pfaff <blp@feldera.com>
@blp
blp merged commit c3ce403 into main Jul 5, 2024
@blp
blp deleted the byte-size branch July 5, 2024 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API Distributed system APIs DBSP core Related to the core DBSP library storage Persistence for internal state in DBSP operators

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make min_storage_rows based on bytes instead of the count

3 participants