ChoMinGi commented on code in PR #22102:
URL: https://github.com/apache/kafka/pull/22102#discussion_r4006964468
##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/InternalTopologyBuilder.java:
##########
@@ -621,7 +621,10 @@ public final void addStateStore(final StoreFactory
storeFactory,
throw new TopologyException("A different GlobalStateStore has
already been added with the name " + storeName);
}
- stateFactories.put(storeName, storeFactory);
+ // Reuse existing compatible factory to preserve
connectedProcessorNames (KAFKA-20464).
+ if (stateFactory == null || allowOverride) {
Review Comment:
@chia7712
Thanks, I checked the code and its history, and I agree.
Since this PR has already been merged and backported, I’ll follow up with a
separate MINOR PR against trunk to remove the unused `allowOverride` parameter
and simplify `addStateStore` using `putIfAbsent`.
I’ll link the follow-up PR here once it’s open.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]