Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Database.LSMTree.Internal.Config.Override
Contents
Documentation
Limitations
Overriding config options should in many cases be possible as long as there is a mitigation strategy to ensure that a change in options does not cause the database state of a table to become inconsistent. But what does this strategy look like? And if we allow a config option to be overridden on a live table (one that a user has access to), how should we apply these new options to shared data like merging runs? Moreover, would we answer these questions differently for each type of config option?
For now, it seems to be the most straightforward to limit the config options we allow to be overridden, and that we only change the config options offline. That is, we override the config option just before opening a snapshot from disk. At that point, there is no sharing because the table is not live yet, which simplifies how changing a config option is handled.
Another complicating factor is that we have thought about the possibility of restoring sharing of ongoing merges between live tables and newly opened snapshots. At that point, we run into the same challenges again... But for now, changing only the disk cache policy and merge batch size offline should work fine.
Override table config
data TableConfigOverride Source #
The TableConfigOverride
can be used to override the TableConfig
when opening a table from a snapshot.
Constructors
TableConfigOverride | |
Instances
Show TableConfigOverride Source # | |
Defined in Database.LSMTree.Internal.Config.Override Methods showsPrec :: Int -> TableConfigOverride -> ShowS # show :: TableConfigOverride -> String # showList :: [TableConfigOverride] -> ShowS # | |
Eq TableConfigOverride Source # | |
Defined in Database.LSMTree.Internal.Config.Override Methods (==) :: TableConfigOverride -> TableConfigOverride -> Bool # (/=) :: TableConfigOverride -> TableConfigOverride -> Bool # |
noTableConfigOverride :: TableConfigOverride Source #
No override of the TableConfig
. You can use this as a default value and
record update to override some parameters, while being future-proof to new
parameters, e.g.
noTableConfigOverride { overrideDiskCachePolicy = DiskCacheNone }
overrideTableConfig :: TableConfigOverride -> SnapshotMetaData -> SnapshotMetaData Source #
Override the a subset of the table configuration parameters that are stored in snapshot metadata.
Tables opened from the new SnapshotMetaData
will use the new value for the
table configuration.