-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix data race when moving a stream (#5880)
There was a data race that triggered in `TestJetStreamSuperClusterMoveCancel` due to the addition of JetStream asset version metadata. All JS API requests receive user-provided `StreamConfig`/`ConsumerConfig`, which ensures that any mutations done in `setStaticStreamMetadata` for example is safe. However, `jsLeaderServerStreamMoveRequest` and `jsLeaderServerStreamCancelMoveRequest` would use the `sa.Config` from the stream assignment and call into `jsClusteredStreamUpdateRequest`. This resulted in a reference to the same `Metadata` map being available and modified. To ensure any changes made to config defaults or metadata doesn't result in a data race, a `StreamConfig.clone` method is added. [data-race-TestJetStreamSuperClusterMoveCancel.txt](https://github.com/user-attachments/files/16968281/data-race-TestJetStreamSuperClusterMoveCancel.txt) Signed-off-by: Maurice van Veen <[email protected]> --------- Signed-off-by: Maurice van Veen <[email protected]>
- Loading branch information
1 parent
789a216
commit 93d173c
Showing
3 changed files
with
73 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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