Skip to content

Commit

Permalink
833 datastream wrong end batch entry 2 (#841)
Browse files Browse the repository at this point in the history
* refactor datastream server

* optimization and nil checks

* added a datastream check tool

* fix rpc to seqencer switching in datastream

* move batch end check after injected

* fix 0 batch gap bug
  • Loading branch information
V-Staykov authored Jul 23, 2024
1 parent fc8972b commit dc3cbcc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion zk/datastream/server/data_stream_server_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ func createBatchStartEntriesProto(
var err error
var batchStartEntries []DataStreamEntryProto

entries := NewDataStreamEntries(2 + int(3*(batchGap-1)) + len(gers))
batchGapEntriesCount := int(batchGap) - 1
if batchGapEntriesCount < 0 {
batchGapEntriesCount = 0
}
entries := NewDataStreamEntries(2 + 3*batchGapEntriesCount + len(gers))

// if we have a gap of more than 1 batch then we need to write in the batch start and ends for these empty batches
if batchGap > 1 {
Expand Down

0 comments on commit dc3cbcc

Please sign in to comment.