This repository was archived by the owner on Feb 6, 2026. It is now read-only.
feat(rebaser): Rebaser uses layerdb activites#3482
Merged
si-bors-ng[bot] merged 1 commit intomainfrom Mar 28, 2024
Merged
Conversation
f8c5844 to
52f539e
Compare
This refactors the rebaser to use a layerdb activities stream. Under the hood it uses a NATS Jetstream work queue. * Makes subscriptions to activities multiplexed (unless they are a work queue) * Adds integration test activities * Adds rebase and rebase_and_wait, which waits for a finish event * Removes the rebaser-client crate, which is no longer neccessary
52f539e to
ed2bc7c
Compare
Contributor
Author
|
bors merge |
nickgerace
approved these changes
Mar 28, 2024
Comment on lines
1119
to
1123
| async fn rebase( | ||
| tenancy: &Tenancy, | ||
| nats: NatsClient, | ||
| rebaser_config: RebaserClientConfig, | ||
| layer_db: &DalLayerDb, | ||
| rebase_request: RebaseRequest, | ||
| ) -> Result<Option<Conflicts>, TransactionsError> { |
| layer_db.clone(), | ||
| ); | ||
|
|
||
| // Setup the subjects. |
Comment on lines
+71
to
+72
| info!("subscribing to work queue"); | ||
| let stream = layer_db.activity().rebase().subscribe_work_queue().await?; |
Comment on lines
+111
to
118
| RebaseStatus::Success { | ||
| updates_performed: serde_json::to_value(updates)?.to_string(), | ||
| } | ||
| } else { | ||
| ReplyRebaseMessage::ConflictsFound { | ||
| conflicts_found: serde_json::to_value(conflicts)?, | ||
| updates_found_and_skipped: serde_json::to_value(updates)?, | ||
| RebaseStatus::ConflictsFound { | ||
| conflicts_found: serde_json::to_value(conflicts)?.to_string(), | ||
| updates_found_and_skipped: serde_json::to_value(updates)?.to_string(), | ||
| } |
Contributor
There was a problem hiding this comment.
For the future: potential use concrete types in the response. We might only need Conflicts too.
Comment on lines
+75
to
+76
| // NOTE: We're basically smashing the data in here, and we really do have to figure out what we | ||
| // actually want when things work / or don't work. |
Comment on lines
+143
to
+146
| // Why is this in two? We want to start listening before the publish call, to ensure we | ||
| // aren't racing with any listening service. | ||
| let start = Instant::now(); | ||
| let rx = self.rebase_finished_activity_stream().await?; |
Contributor
|
Build succeeded: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

This refactors the rebaser to use a layerdb activities stream. Under the hood it uses a NATS Jetstream work queue.