...
The producerId in the request is used to disambiguate requests following expiration of the transactionalId. After a transactional id has expired, its state is removed from the log. If the id is used again in the future, a new producerId will be generated. For a producer which is being initialized for the first time, the producerId and epoch will be set to -1. For a producer which is reinitializing, a positive valued producerId and epoch must be provided. If either producerId or epoch is initialized to -1 and the other is not, the broker will return the INVALID_REQUEST error code.
As mentioned above, we will bump the version of the transaction state message to include the last epoch.
...