Skip to content

[pull] memtable_as_log_index from topling:memtable_as_log_index#4

Open
pull[bot] wants to merge 102 commits into
hugegraph:memtable_as_log_indexfrom
topling:memtable_as_log_index
Open

[pull] memtable_as_log_index from topling:memtable_as_log_index#4
pull[bot] wants to merge 102 commits into
hugegraph:memtable_as_log_indexfrom
topling:memtable_as_log_index

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Mar 15, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

@pull pull Bot locked and limited conversation to collaborators Mar 15, 2026
@pull pull Bot added the ⤵️ pull label Mar 15, 2026
@rockeet rockeet force-pushed the memtable_as_log_index branch 2 times, most recently from 9b42dd6 to 5c00a65 Compare March 18, 2026 15:47
@rockeet rockeet force-pushed the memtable_as_log_index branch from 5c00a65 to 68fbc5f Compare March 18, 2026 15:53
@rockeet rockeet force-pushed the memtable_as_log_index branch from 538e4a3 to b0622bb Compare March 19, 2026 04:03
@rockeet rockeet force-pushed the memtable_as_log_index branch from b0622bb to 1aa07fa Compare March 19, 2026 04:04
@rockeet rockeet force-pushed the memtable_as_log_index branch from 70b0c77 to 8a40448 Compare March 20, 2026 07:00
@rockeet rockeet force-pushed the memtable_as_log_index branch from 8a40448 to 355304b Compare March 20, 2026 07:05
@rockeet rockeet force-pushed the memtable_as_log_index branch from e4ecd25 to 0892907 Compare March 20, 2026 10:09
Allow closing a single DB instance managed by the repo.
@rockeet rockeet force-pushed the memtable_as_log_index branch from f07d1df to 207a070 Compare May 2, 2026 10:00
@rockeet rockeet force-pushed the memtable_as_log_index branch 2 times, most recently from 720d183 to 80f7c95 Compare May 4, 2026 09:46
These two methods let users keep their existing DBOptions and CFOptions
construction code while selectively applying options from a SidePluginRepo
YAML/JSON config.  Users load a config file into a SidePluginRepo, then call

  side_plugin_db_options_update_from(opt, repo, "name");
  side_plugin_cf_options_update_from(opt, repo, "name");

to overlay the repo's named options onto hand-crafted Options objects.

This migration path preserves all ToplingDB engine optimizations (MemTable,
SST formats, etc.) but foregoes SidePlugin features that depend on full
SidePluginRepo-managed lifecycle: Web UI observability, Prometheus
integration, online config hot-update, and distributed compaction.
@rockeet rockeet force-pushed the memtable_as_log_index branch from 80f7c95 to bf54b9c Compare May 4, 2026 11:35
rockeet added 3 commits May 4, 2026 20:40
Also override CFOptions in CreateColumnFamily, override options through
MaybeOptionsUpdateFrom()

If import the conf file failed, the process dies immediately
Under TOPLINGDB_EASY_MIGRATE_CONF, db-path components are treated as
a namespace hierarchy for config lookup, from most specific (full path)
to most general ("default"). CFOptions now follow the same path-prefix
walk with bare-name and "default" fallbacks that DBOptions always had.

Design rationale: https://github.com/topling/rockside/wiki/Easy-Migrate-Without-Code-Change
@rockeet rockeet force-pushed the memtable_as_log_index branch from b1128dc to 18084ab Compare May 5, 2026 15:42
rockeet added 8 commits May 6, 2026 15:07
- Call MaybeRetainDB via ROCKSDB_SCOPE_EXIT after successful DBImpl::Open, ReadOnly, and Secondary opens.
- Call MaybeForgetDB at the start of ~DBImpl.
- Clear *dbptr before attaching scope exit to avoid retaining on early validation failure; setting *dbptr = nullptr here also fixes an obscure upstream bug where the output pointer could be left uncleared when validation fails before the later assignment.
- Bump rockside for EasyMigrate HTTP gating and retain/forget implementation.
The MaybeRetainDB fix in the rockside submodule needs to read
persist_stats_cf_handle_ from a DB* pointer, but it is a private
member with no accessor. Add a public accessor and a wrapper
function, and update the submodule to use them.

The submodule fix replaces dangling default_cfh and stat_cfh
handles with live pointers before storing them in the sideplugin
repo, since RocksDB deletes the original handles on simple Open.
Track column family lifecycle in the sideplugin repo during easy
migrate: register CF in CreateColumnFamily via scope-exit guard,
and unregister in DropColumnFamily before the handle becomes
invalid.
Pulls in the yaml config change and the MaybeRetainCF/MaybeForgetCF
implementation in the submodule.
Expose ReadOptions::internal_is_in_pinning_section through the C API,
needed by Rust bindings for ReadOptionsScopePinIfNotPinned guard.
@rockeet rockeet force-pushed the memtable_as_log_index branch from f5bd243 to 5d68e7e Compare May 16, 2026 08:12
rockeet and others added 3 commits May 18, 2026 23:27
…ndex option

When DB Open replays WAL files, the reader was unconditionally
configured based on the current memtable_as_log_index option. If
the option changed between runs (e.g. config file or env var),
the WAL records would be parsed with the wrong header format,
causing CRC mismatch and recovery failure.

Now IsMemTableAsLogIndexFile() probes the actual on-disk format
of each WAL file before replay, and the reader uses the detected
format regardless of the current option setting.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Previously WAL format was detected unconditionally via CRC32 self-
consistency on every DB open, which carries a 1/2^32 false-positive
risk per file. This risk is only relevant when memtable_as_log_index
was actually changed between runs — an extremely rare event.

Gate the detection behind DBOptions::check_wal_format (default false)
so users only pay the risk when they know a format switch occurred.
This reduces false-positive exposure by orders of magnitude without
requiring any WAL format changes.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@rockeet rockeet force-pushed the memtable_as_log_index branch from 609a616 to 8fa8e5d Compare May 18, 2026 16:40
rockeet and others added 4 commits May 19, 2026 01:03
…format is set

When the user explicitly opts into check_wal_format, a detection I/O
error should not be silently skipped — it must be surfaced so the user
can correct the situation (e.g. revert memtable_as_log_index and retry).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…lure

Ensures the log always records which file and what error caused
the detection to fail, consistent across all call sites.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant