Skip to content
Prev Previous commit
Next Next commit
Fix sequence assignment
  • Loading branch information
akrambek committed Jan 13, 2024
commit 523809723aec2414ac1ec7959ddffae9a8faa78b
Original file line number Diff line number Diff line change
Expand Up @@ -551,9 +551,14 @@ private int flushRecordInit(
client.doEncodeRequestIfNecessary(traceId, budgetId);
}

if (client.producerId == RECORD_BATCH_PRODUCER_ID_NONE ||
client.producerId != producerId)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be && instead?

Please remove extra whitespace around !=.

{
client.sequence = sequence;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest we rename to client.baseSequence.

}

client.producerId = producerId;
client.producerEpoch = producerEpoch;
client.sequence = sequence;

client.doEncodeRecordInit(traceId, timestamp, ackMode, key, payload, headers);
if (client.encodeSlot != NO_SLOT)
Expand Down