rondagostino opened a new pull request #10322:
URL: https://github.com/apache/kafka/pull/10322


   OffsetValidationTest.test_broker_rolling_bounce was failing when used with a 
Raft-based metadata quorum but succeeding with a ZooKeeper-based quorum.  The 
problem was that in the Raft case the consumer was sometimes receiving a 
METADATA response with just 1 alive broker, and then when that broker rolled 
the consumer wouldn't know about any alive nodes.  It would have to wait until 
the broker returned before it could reconnect, and by that time the group 
coordinator on the second broker would have timed-out the client and initiated 
a group rebalance.  The test explicitly checks that no rebalances occur, so the 
test would fail.  It turns out that the reason why the ZooKeeper configuration 
wasn't seeing rebalances was just plain luck.  The brokers' metadata caches in 
the ZooKeeper configuration show 1 alive broker even more frequently than the 
Raft configuration does.  If we tweak the metadata.max.age.ms value on the 
consumers we can easily get the ZooKeeper test to fail, and in fact
  this system test has historically been flaky for the ZoKeeper configuration.  
We can get the test to pass by setting session.timeout.ms=30000 (which is 
longer than the roll time of any broker), or we can increase the broker count 
so that the client never sees a METADATA response with just a single alive 
broker and therefore never loses contact with the cluster for an extended 
period of time.
   
   This patch increases the broker count for this particular system test from 2 
to 3.
   
   This patch also fixes a minor logging bug that was discovered in 
`RaftReplicaManager` that was discovered during the debugging of this issue, 
and it adds an extra logging statement when a single metadata batch is applied 
to mirror the same logging statement that occurs when deferred metadata changes 
are applied.
   
   
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


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

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


Reply via email to