Skip to content

Commit

Permalink
Revert "add assert to check integer overflow for table size (#1402)" (#…
Browse files Browse the repository at this point in the history
…1406)

This reverts commit 7f4e4b5. 
This revert is necessary because b.sz won't exist after builder changes are
reverted and the assert is no longer valid.

The commit 7f4e4b5 is being reverted because we have seen some crashes
which could be caused by these changes. We haven't been able to reproduce the
crashes yet.

Related to #1389, #1388, #1387
Also see https://discuss.dgraph.io/t/current-state-of-badger-crashes/7602
  • Loading branch information
Ibrahim Jarif committed Oct 2, 2020
1 parent 259c185 commit 5eb5c41
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions table/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,6 @@ func (b *Builder) shouldFinishBlock(key []byte, value y.ValueStruct) bool {
// So, size of IV is added to estimatedSize.
estimatedSize += aes.BlockSize
}
// Integer overflow check for table size.
y.AssertTrue(uint64(b.sz)+uint64(estimatedSize) < math.MaxUint32)

return estimatedSize > uint32(b.opt.BlockSize)
}

Expand Down

0 comments on commit 5eb5c41

Please sign in to comment.