gaurav-narula commented on code in PR #15521:
URL: https://github.com/apache/kafka/pull/15521#discussion_r1521612209


##########
server/src/main/java/org/apache/kafka/server/AssignmentsManager.java:
##########
@@ -202,9 +199,12 @@ public void run() throws Exception {
                     return;
                 }
                 if (existing.timestampNs > timestampNs) {
-                    existing.onComplete();
-                    if (log.isDebugEnabled()) log.debug("Dropping assignment 
{} because it's older than {}", this, existing);
+                    existing.merge(this);
+                    if (log.isDebugEnabled()) log.debug("Dropping assignment 
{} because it's older than existing {}", this, existing);

Review Comment:
   I think we can avoid `log.isDebugEnabled()` and the like when using 
parameterised messages. Refer https://www.slf4j.org/faq.html#logging_performance



##########
server/src/main/java/org/apache/kafka/server/AssignmentsManager.java:
##########
@@ -202,9 +199,12 @@ public void run() throws Exception {
                     return;
                 }
                 if (existing.timestampNs > timestampNs) {
-                    existing.onComplete();
-                    if (log.isDebugEnabled()) log.debug("Dropping assignment 
{} because it's older than {}", this, existing);
+                    existing.merge(this);
+                    if (log.isDebugEnabled()) log.debug("Dropping assignment 
{} because it's older than existing {}", this, existing);
                     return;
+                } else {
+                    this.merge(existing);

Review Comment:
   Doesn't this result in the callback handlers for existing being run twice if 
existing was retrieved from inflight?



-- 
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]

Reply via email to