ijuma commented on code in PR #18845:
URL: https://github.com/apache/kafka/pull/18845#discussion_r1950090651


##########
metadata/src/main/java/org/apache/kafka/controller/QuorumController.java:
##########
@@ -1652,9 +1652,7 @@ private void registerWriteNoOpRecord(long 
maxIdleIntervalNs) {
         periodicControl.registerTask(new PeriodicTask("writeNoOpRecord",
             () -> {
                 ArrayList<ApiMessageAndVersion> records = new ArrayList<>(1);
-                if (featureControl.metadataVersion().isNoOpRecordSupported()) {
-                    records.add(new ApiMessageAndVersion(new NoOpRecord(), 
(short) 0));
-                }
+                records.add(new ApiMessageAndVersion(new NoOpRecord(), (short) 
0));

Review Comment:
   The new version would make `records` immutable while the current code 
exposes the mutable `records` via `ControllerResult.records()`. Do you know if 
this change is safe? My cursory look indicates it may be ok, but I would have 
to look at this more carefully. Given that, I think we should also do this via 
a different PR (to avoid including a potential behavior change in the middle of 
this clean-up PR).



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to