horaedb icon indicating copy to clipboard operation
horaedb copied to clipboard

fix: disable layered memtable in overwrite mode

Open Rachelint opened this issue 9 months ago • 0 comments

Rationale

Layered memtable is only designed for append mode table now, and it shouldn't be used in overwrite mode table.

Detailed Changes

  • Make default values in config used.
  • Add enable field to control layered memtable's on/off.
  • Add check to prevent invalid options during table create/alter.
  • Add related it cases.

Test Plan

Test manually.

Following cases are considered:

Check and intercept the invalid table options during table create/alter

  • enable layered memtable but mutable switch threshold is 0
  • enable layered memtable for overwrite mode table

Table options new field layered_enable's default value when it is not found in pb

  • false, when whole layered_memtable_options not exist
  • false, when layered_memtable_options exist, and mutable_segment_switch_threshold == 0
  • true, when layered_memtable_options exist, and mutable_segment_switch_threshold > 0

Rachelint avatar May 23 '24 11:05 Rachelint