Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions crates/walrus-service/src/node/dbtool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ use crate::{
blob_info_cf_options,
per_object_blob_info_cf_options,
per_object_pooled_blob_info_cf_options,
storage_pool_info_cf_options,
},
constants::{
aggregate_blob_info_cf_name,
Expand All @@ -72,6 +73,7 @@ use crate::{
secondary_slivers_column_family_name,
storage_pool_info_cf_name,
},
event_cursor_cf_options,
},
},
};
Expand Down Expand Up @@ -1198,11 +1200,13 @@ fn cf_options_for_name(
name if name == per_object_pooled_blob_info_cf_name() => {
per_object_pooled_blob_info_cf_options(factory)
}
name if name == storage_pool_info_cf_name() => factory.storage_pool_info(),
name if name == storage_pool_info_cf_name() => {
storage_pool_info_cf_options(factory)
}
name if name == event_index_cf_name() => factory.standard(),
name if name == metadata_cf_name() => factory.metadata(),
name if name == node_status_cf_name() => factory.node_status(),
name if name == event_cursor_cf_name() => factory.event_cursor(),
name if name == event_cursor_cf_name() => event_cursor_cf_options(factory),
name if name == garbage_collector_table_cf_name() => factory.garbage_collector(),
_ => RocksdbOptions::default(),
}
Expand Down
1 change: 1 addition & 0 deletions crates/walrus-service/src/node/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ pub use database_config::{DatabaseConfig, DatabaseTableOptionsFactory};

mod event_cursor_table;
pub(super) use event_cursor_table::EventProgress;
pub(crate) use event_cursor_table::event_cursor_cf_options;

mod event_sequencer;
mod metrics;
Expand Down
24 changes: 17 additions & 7 deletions crates/walrus-service/src/node/storage/event_cursor_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,10 @@ impl EventCursorTable {
}

pub fn options(db_table_opts_factory: &DatabaseTableOptionsFactory) -> (&'static str, Options) {
let mut options = db_table_opts_factory.event_cursor();
options.set_merge_operator(
"update_cursor_and_progress",
update_cursor_and_progress,
|_, _, _| None,
);
(event_cursor_cf_name(), options)
(
event_cursor_cf_name(),
event_cursor_cf_options(db_table_opts_factory),
)
}

pub fn reposition_event_cursor(
Expand Down Expand Up @@ -211,6 +208,19 @@ impl EventCursorTable {
}
}

/// Returns the RocksDB options for the event cursor column family, including the merge operator.
pub(crate) fn event_cursor_cf_options(
db_table_opts_factory: &DatabaseTableOptionsFactory,
) -> Options {
let mut options = db_table_opts_factory.event_cursor();
options.set_merge_operator(
"update_cursor_and_progress",
update_cursor_and_progress,
|_, _, _| None,
);
options
}

#[tracing::instrument(level = Level::DEBUG, skip(operands))]
fn update_cursor_and_progress(
key: &[u8],
Expand Down
Loading