mcmmining commented on code in PR #15521:
URL: https://github.com/apache/kafka/pull/15521#discussion_r1546423981
##########
server/src/main/java/org/apache/kafka/server/AssignmentsManager.java:
##########
@@ -192,24 +189,27 @@ void onComplete() {
@Override
public void run() throws Exception {
AssignmentEvent existing = pending.getOrDefault(partition, null);
+ boolean existingIsInFlight = false;
if (existing == null && inflight != null) {
existing = inflight.getOrDefault(partition, null);
+ existingIsInFlight = true;
}
if (existing != null) {
if (existing.dirId.equals(dirId)) {
existing.merge(this);
- if (log.isDebugEnabled()) log.debug("Ignoring duplicate
assignment {}", this);
+ log.debug("Ignoring duplicate assignment {}", this);
return;
}
if (existing.timestampNs > timestampNs) {
- existing.onComplete();
- if (log.isDebugEnabled()) log.debug("Dropping assignment
{} because it's older than {}", this, existing);
+ existing.merge(this);
+ log.debug("Dropping assignment {} because it's older than
existing {}", this, existing);
return;
+ } else if (!existingIsInFlight) {
+ this.merge(existing);
+ log.debug("Dropping existing assignment {} because it's
older than {}", existing, this);
}
}
- if (log.isDebugEnabled()) {
- log.debug("Received new assignment {}", this);
- }
+ log.debug("Received new assignment {}", this);
Review Comment:
connect/mirror/src/test/java/org/apache/kafka/connect/mirror/integration/MirrorConnectorsIntegrationBaseTest.java
--
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]