rondagostino commented on code in PR #14206:
URL: https://github.com/apache/kafka/pull/14206#discussion_r1340468538
##########
metadata/src/test/java/org/apache/kafka/image/ProducerIdsImageTest.java:
##########
@@ -54,11 +54,24 @@ public class ProducerIdsImageTest {
setBrokerId(3).
setBrokerEpoch(100).
setNextProducerId(789), (short) 0));
+ DELTA1_RECORDS.add(new ApiMessageAndVersion(new ProducerIdsRecord().
+ setBrokerId(3).
+ setBrokerEpoch(100).
+ setNextProducerId(780), (short) 0));
+ DELTA1_RECORDS.add(new ApiMessageAndVersion(new ProducerIdsRecord().
+ setBrokerId(3).
+ setBrokerEpoch(100).
+ setNextProducerId(785), (short) 0));
+ DELTA1_RECORDS.add(new ApiMessageAndVersion(new ProducerIdsRecord().
+ setBrokerId(2).
+ setBrokerEpoch(100).
+ setNextProducerId(460), (short) 0));
DELTA1 = new ProducerIdsDelta(IMAGE1);
RecordTestUtils.replayAll(DELTA1, DELTA1_RECORDS);
- IMAGE2 = new ProducerIdsImage(789);
+ // producer ids must be increasing, but delta replay does not check
this (only QuorumController replay)
Review Comment:
I guess we need to decide what to do with these types of cases. The overall
issue is that right now the various `*Delta` classes will replay pretty much
whatever you give them without complaining -- including stuff that the actual
`QuorumController` would never send and that would be unable to replay.
We could keep these changes as opposed to just silently deleting them from
this PR/ignoring the issue that they point to. If we did that then at a
minimum we should add copious comments about what the test is doing and why we
expect it to never happen/why we are testing it anyway.
But it feels to me that these are strange cases to test, and it might just
be best to open a JIRA ticket to make these various `*Delta` classes actually
reject illegal stuff like this so that we get an exception closer to the point
where the issue actually originates.
--
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]