KAFKA-7322; This is a followup Fix. With previous fix, log retention thread can 
throw illegal state exception when race against topic deletion or truncation.

The following race can happen: 1) log retention set a topic partition to paused 
state 2) topic deletion come and see it is already in paused state and proceed 
3) topic deletion removed the paused state 4)log retention tries to resume the 
same topic partition from a NONE state and throw out an exception.

 In order to fix this situation, we allow a topic partition to be paused 
multiple times.  In addition, a concurrent unit test is added to test race 
condition.


*Summary of testing strategy (including rationale)
Special cooked high concurrent unit test.
Ingesting latency to make the race condition happen in broker, and observed 
both the race happen and the current implementation handled it correctly.

### Committer Checklist (excluded from commit message)
- [ ] Verify design and implementation 
- [ ] Verify test coverage and CI build status
- [ ] Verify documentation (including upgrade notes)


[ Full content available at: https://github.com/apache/kafka/pull/5694 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to