Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mutable should provide self metrics & decouple with Trigger #227

Open
ethe opened this issue Nov 19, 2024 · 0 comments
Open

Mutable should provide self metrics & decouple with Trigger #227

ethe opened this issue Nov 19, 2024 · 0 comments
Assignees
Labels
M - Medium Adding a new feature, refactoring a module, performance optimization. refactor No more features, just refactoring

Comments

@ethe
Copy link
Member

ethe commented Nov 19, 2024

In the current, Mutable memtable is declared as:

pub struct Mutable<R>
where
    R: Record,
{
    pub(crate) data: SkipMap<Timestamped<R::Key>, Option<R>>,
    wal: Option<Mutex<WalFile<Box<dyn DynWrite>, R>>>,
    pub(crate) trigger: Arc<Box<dyn Trigger<R> + Send + Sync>>,
}

trigger is initialized in DB and pass into Mutable by Mutable::new, it returns a boolean in each appending to report whether memtable should be froze or not, and this boolean bubbles again up to the top-level (DB or Transaction) . The triggering path is really long and not efficient. Mutable should give a method to report its metrics,Triggerer is able to observe this metrics and decide the freezing timing, it is a possible efficient way to make the freezing trigger clear.

@ethe ethe self-assigned this Nov 19, 2024
@ethe ethe added M - Medium Adding a new feature, refactoring a module, performance optimization. refactor No more features, just refactoring labels Nov 19, 2024
@ethe ethe added this to Tonbo Nov 19, 2024
@github-project-automation github-project-automation bot moved this to Todo in Tonbo Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
M - Medium Adding a new feature, refactoring a module, performance optimization. refactor No more features, just refactoring
Projects
Status: Todo
Development

No branches or pull requests

1 participant