make maxdelete an optional param

This commit is contained in:
Todd Gruben 2022-03-08 21:16:11 -06:00
parent 1a8989a69b
commit e209759283
3 changed files with 8 additions and 1 deletions

View file

@ -8504,7 +8504,7 @@ func DeleteRowsWithFlow(ctx context.Context, src *Row, idx *Index, shard uint64,
}
var change bool
var err error
limit := 65536
limit := idx.holder.cfg.RBFConfig.MaxDelete
for i := 0; i < len(bits); i += limit {
batch := roaring.NewBitmap(bits[i:min(i+limit, len(bits))]...)
if idx.Keys() {

View file

@ -41,6 +41,9 @@ type Config struct {
// background checkpoints. It cannot be set from toml. The default is
// to use stderr.
Logger logger.Logger `toml:"-"`
// The maximum number of bits to be deleted in a single transaction default(65536)
MaxDelete int `toml:"max-delete"`
}
func NewDefaultConfig() *Config {
@ -50,6 +53,7 @@ func NewDefaultConfig() *Config {
MinWALCheckpointSize: DefaultMinWALCheckpointSize,
MaxWALCheckpointSize: DefaultMaxWALCheckpointSize,
FsyncEnabled: true,
MaxDelete: DefaultMaxDelete,
// CI passed with 20. 50 was too big for CI, even on X-large instances.
// For now we default to 0, which means use sync.Pool.

View file

@ -13,3 +13,6 @@ const DefaultMaxSize = 4 * (1 << 30)
// size of the WAL. The size can be increased by updating the DB.MaxWALSize
// and reopening the database. This setting mainly affects virtual space usage.
const DefaultMaxWALSize = 4 * (1 << 30)
// DefaultMaxDelete is the maximum number of bits that will be deleted in a single batch
const DefaultMaxDelete = 65536