THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
- If no producerId/epoch is provided, the producer is initializing for the first time. We
- If there is no current producerId/epoch, generate a new producerId and set epoch=0.
- Otherwise, we need to bump the epoch, which could mean overflow
- :
- No overflow: Bump the epoch and return the current producerId with the bumped epoch. The last producerId/epoch will be set to empty.
- Overflow: Initialize a new producerId with epoch=0 and return it. The last producerId/epoch will be set to empty.
- If producerId/epoch is provided, then the producer is re-initializing after a failure. There are three cases:
- The provided producerId/epoch matches the existing producerId/epoch, so we need to bump the epoch. As above, we may need to generate a new producer producerId if there would be overflow bumping the epoch.
- No overflow: bump the epoch and return the current producerId with the bumped epoch. The last producerId/epoch will be set to the previous producerId/epoch.
- Overflow: generate a new producerId with epoch=0. The last producerId/epoch will be set to the old producerId/epoch.
- The provided producerId/epoch matches the last producerId/epoch. The current producerId/epoch will be returned.
- Else return INVALID_PRODUCER_EPOCH
- The provided producerId/epoch matches the existing producerId/epoch, so we need to bump the epoch. As above, we may need to generate a new producer producerId if there would be overflow bumping the epoch.
...