Skip to content

[pull] memtable_as_log_index from topling:memtable_as_log_index#4

Open
pull[bot] wants to merge 94 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 94 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
@rockeet rockeet force-pushed the memtable_as_log_index branch from da95133 to c78a892 Compare April 20, 2026 15:11
rockeet added 3 commits April 24, 2026 22:00
…, slice_transform, and filter_policy

Provide extern "C" registration functions enabling C-language plugin authors to
register their custom plugins with the side plugin framework. Five plugin types
are covered:

  - comparator:       bare const pointer (PluginFactory<const Comparator*>)
  - merge_operator:   shared_ptr (PluginFactory<std::shared_ptr<MergeOperator>>)
  - compaction_filter_factory: shared_ptr (ditto for CompactionFilterFactory)
  - slicetransform:   shared_ptr<const SliceTransform>
  - filterpolicy:     shared_ptr<const FilterPolicy>

Each has a register/unregister pair.

Two internal template helpers bridge the C/C++ boundary:

  - side_plugin_register_raw_ptr_plugin<Object, FFI_Object>
    wraps a C creator (returning FFI_Object*) into a PluginFactory AcqFunc that
    returns Object*. Used for comparator, which the framework stores as bare
    const pointer.

  - side_plugin_register_shared_ptr_plugin<Object, FFI_Object>
    likewise wraps a C creator, then wraps the returned pointer in a
    shared_ptr<Object>. The C bridge objects (rocksdb_mergeoperator_t, etc.)
    have proper destructors that invoke the user-provided cleanup callback,
    so normal shared_ptr deletion is safe — no intentional leak needed.

Each wrapper lambda converts the C++ SidePluginRepo reference back to a C
side_plugin_repo_t* (validated by static_assert that the C struct has the C++
object as its first member via offsetof == 0), and serializes the C++ json to a
C string at the FFI boundary.
@rockeet rockeet force-pushed the memtable_as_log_index branch from 4d817eb to 9f0964f Compare May 1, 2026 09:32
rockeet added 5 commits May 2, 2026 15:44
Include side_plugin_tpl_inst.cc: add explicit_instantiate_serde(FilterPolicy)
Add FFI_SerDe/FFI_WebManip for distributed compaction serde
and webview bridge. Introduce side_plugin_ex_vtab_t for
C-side vtable. Update all register/unregister functions to
support extended vtab (serde + web).
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 7 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.
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