WIP kvs-watch: do not load all KVS blobs at once #6532
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem: With the FLUX_KVS_WATCH_APPEND and FLUX_KVS_STREAM flags, all content blobs in a valref treeobj will be retrieved from the content store at once. If the valref array is gigantic, this may be a very costly initial transaction. Not to mention, we probably wouldn't want to send an extremely large number (like millions) of content requests all at once.
Solution: Send content requests in more reasonable 32K chunks.
Fixes #6456
So this is what I initially started working on that lead more to #6531 and #6518.
This issue is mostly theoretical, as I don't have a use case where this is a problem at the moment. I want to try and manufacture a use case and test it, which is why I'm posting this as WIP. But I thought I'd post and see if folks think it's atleast a good idea.
I should note, I did run the test suite when having the "max loads" set to 2 instead of 32K, so it generally speaking appears to work safely. Although the question of how big the "maximum number of loads at a time" number could possibly be tweaked up or down some.