Skip to content

Commit

Permalink
[Broker] Fix replicated subscriptions related LightProto issues (#10247)
Browse files Browse the repository at this point in the history
* [Broker] Make copy of MarkersMessageIdData since instances are reused

- LightProto reuses thread local instances and therefore a copy must be made

* [Broker] Make copy of ReplicatedSubscriptionsSnapshot since instances are reused
  • Loading branch information
lhotari authored Apr 16, 2021
1 parent 152d1e6 commit 8128b88
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ protected Map<String, Long> mergeCursorProperties(Map<String, Long> userProperti
public void processReplicatedSubscriptionSnapshot(ReplicatedSubscriptionsSnapshot snapshot) {
ReplicatedSubscriptionSnapshotCache snapshotCache = this.replicatedSubscriptionSnapshotCache;
if (snapshotCache != null) {
snapshotCache.addNewSnapshot(snapshot);
snapshotCache.addNewSnapshot(new ReplicatedSubscriptionsSnapshot().copyFrom(snapshot));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ synchronized void receivedSnapshotResponse(Position position, ReplicatedSubscrip
response.getCluster().getCluster());
}
String cluster = response.getCluster().getCluster();
responses.putIfAbsent(cluster, response.getCluster().getMessageId());
responses.putIfAbsent(cluster, new MarkersMessageIdData().copyFrom(response.getCluster().getMessageId()));
missingClusters.remove(cluster);

if (log.isDebugEnabled()) {
Expand Down

0 comments on commit 8128b88

Please sign in to comment.