Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make compactRange() non-blocking #597

Closed
cadonna opened this issue Jul 4, 2023 · 1 comment · Fixed by #656
Closed

Make compactRange() non-blocking #597

cadonna opened this issue Jul 4, 2023 · 1 comment · Fixed by #656
Assignees
Labels
enhancement New feature or request Kafka-Streams Issues that are relevant to Kafka Streams - but not only

Comments

@cadonna
Copy link

cadonna commented Jul 4, 2023

Owner:

Is your feature request related to a problem? Please describe.
In Kafka Streams up to 2.6, to speed up restoration of RocksDB-backed state stores, we used to apply bulk loading when restoring. We used Options::prepareForBulkLoad() for that. So all data was first written to L0 during restoration without any compactions. When restoration ended and before normal processing started, we switched the state store back to non-bulk-loading mode. Now compactions started on all the restored data on L0. During a compaction writes to the state store stall. These meant, we sometimes experienced write stalls when normal processing started. The duration of these write stalls exceeded a timeout that we have in Kafka Streams (max.poll.interval.ms for the interested reader) which hindered progress in processing. Due to this issue, we removed bulk loading during restoration.

Now we did some improvements in restoration that would maybe allow to re-add bulk loading during restoration. However, we would need to make a manual compaction with compactRange() before we switch to normal processing for a specific store. Since we have multiple state stores to restore, we do not want to be blocked by the manual compaction of each state store after restoration. We would rather want to start manual compaction for one state store that finished restoration and then continue to restore the other state stores. Once the compaction on the state store has finished we want to switch it to normal processing. For that we need some ways to verify if the compaction has ended like a future.

Describe the solution you'd like
A non-blocking compactRange() and a way to verify that the compaction started with compactRange() finished.

@bosmatt bosmatt moved this to 🔮 Future in Speedb Roadmap Jul 9, 2023
@bosmatt bosmatt added the enhancement New feature or request label Jul 9, 2023
@udi-speedb udi-speedb self-assigned this Aug 10, 2023
@udi-speedb udi-speedb moved this from 🔮 Future to 🔎 Researching in Speedb Roadmap Aug 10, 2023
udi-speedb added a commit that referenced this issue Aug 29, 2023
Add a new option to CompactRangeOptions, a callback object. By defaut,
the callback is empty so CompactRange() will be blocking (as it is now).
If the callback is set, the callback object's callback method will be
called upon completion with the completion status.
udi-speedb added a commit that referenced this issue Aug 29, 2023
Add a new option to CompactRangeOptions, a callback object. By defaut,
the callback is empty so CompactRange() will be blocking (as it is now).
If the callback is set, the callback object's callback method will be
called upon completion with the completion status.
udi-speedb added a commit that referenced this issue Sep 6, 2023
Add a new option to CompactRangeOptions, a callback object. By defaut,
the callback is empty so CompactRange() will be blocking (as it is now).
If the callback is set, the callback object's callback method will be
called upon completion with the completion status.
@Guyme Guyme added the Kafka-Streams Issues that are relevant to Kafka Streams - but not only label Sep 10, 2023
Yuval-Ariel pushed a commit that referenced this issue Sep 18, 2023
Add a new option to CompactRangeOptions, a callback object. By default,
the callback is empty so CompactRange() will be blocking (as it is now).
If the callback is set, the callback object's callback method will be
called upon completion with the completion status.
@github-project-automation github-project-automation bot moved this from 🔎 Researching to 📖 Need your Opinion! in Speedb Roadmap Sep 18, 2023
@mjsax
Copy link

mjsax commented Oct 5, 2023

🎉

@bosmatt bosmatt moved this from 📖 Need your Opinion! to ✅ Shipped in Speedb Roadmap Oct 22, 2023
udi-speedb added a commit that referenced this issue Nov 23, 2023
Add a new option to CompactRangeOptions, a callback object. By default,
the callback is empty so CompactRange() will be blocking (as it is now).
If the callback is set, the callback object's callback method will be
called upon completion with the completion status.
udi-speedb added a commit that referenced this issue Dec 6, 2023
Add a new option to CompactRangeOptions, a callback object. By default,
the callback is empty so CompactRange() will be blocking (as it is now).
If the callback is set, the callback object's callback method will be
called upon completion with the completion status.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Kafka-Streams Issues that are relevant to Kafka Streams - but not only
Projects
Status: ✅ Shipped
Development

Successfully merging a pull request may close this issue.

5 participants