Details
-
Sub-task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Currently `RaftClient` has the following Append API:
Long scheduleAppend(int epoch, List<T> records);
There are a few possible cases that the single return value is trying to handle:
1. The epoch doesn't match or we are not the current leader => return Long.MaxValue
2. We failed to allocate memory to write the the batch (backpressure case) => return null
3. We successfully scheduled the append => return the expected offset
It might be better to define a richer type so that the cases that must be handled are clearer. At a minimum, it would be better to return `OptionalLong` and get rid of the null case.
Attachments
Issue Links
- is related to
-
KAFKA-13148 Kraft Controller doesn't handle scheduleAppend returning Long.MAX_VALUE
- Resolved
- links to