Skip to content

Commit

Permalink
add stronger fencing from KIP-447
Browse files Browse the repository at this point in the history
  • Loading branch information
twmb committed Feb 2, 2020
1 parent b17c45f commit 04f9b84
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/kgo/consumer_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -1481,19 +1481,21 @@ func (g *groupConsumer) commitTxn(
g.commitCancel = commitCancel
g.commitDone = commitDone

memberID := g.memberID

// We issue this request even if the producer ID is failed; the request
// will fail if it is.
//
// The id must have been set at least once by this point because of
// addOffsetsToTxn.
id, epoch, _ := g.cl.producerID()
memberID := g.memberID
req := &kmsg.TxnOffsetCommitRequest{
TransactionalID: *g.cl.cfg.txnID,
Group: g.id,
ProducerID: id,
ProducerEpoch: epoch,
Generation: g.generation,
MemberID: memberID,
InstanceID: g.instanceID,
}

if ctx.Done() != nil {
Expand Down

0 comments on commit 04f9b84

Please sign in to comment.