fvaleri commented on code in PR #24320:
URL: https://github.com/apache/kafka/pull/24320#discussion_r4678644234
##########
metadata/src/main/java/org/apache/kafka/image/TopicsDelta.java:
##########
@@ -249,6 +272,16 @@ public LocalReplicaChanges localChanges(int brokerId) {
followers.putAll(changes.followers());
topicIds.putAll(changes.topicIds());
directoryIds.putAll(changes.directoryIds());
+
+ // Compare against the existing topics image rather than the topic
delta's image. When a broker loads a snapshot
+ // after being offline, its local metadata log may contain a stale
mirror association that was removed while it
+ // was offline. Comparing against the existing image ensures that
this removal is detected.
+ // Incremental update example: local log (mirror-A, MIRRORING) -->
fetched snapshot (null, UNKNOWN).
+ // Snapshot update example: local log (mirror-A, MIRRORING) -->
fetched snapshot (null, UNKNOWN).
Review Comment:
```suggestion
// Example: local log (mirror-A, MIRRORING) --> fetched snapshot
or incremental update (null, UNKNOWN).
```
This is actually my fault, as I suggested this comment without updating the
incremental example at the end. We can now reduce to one example.
--
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]