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

Prevent opening datastore as read-write when it is already opened in read-only mode #346

Open
liss-h opened this issue Feb 7, 2025 · 1 comment
Assignees

Comments

@liss-h
Copy link
Contributor

liss-h commented Feb 7, 2025

Currently, metall prevents to open the same datastore as read-write twice at the same time.
However, it allows to open a datastore as read-write even if it is already opened in read-only mode.

This causes issues/corruption when the read-writer actually writes. Metall should prevent this.

The desired behaviour would be, allow either:

  • exactly one read-writer, no one else
  • many readers, but no read-writer

Small snippet to reproduce:

{ // create datastore
    metall::manager mgr{metall::create_only, path};
}

metall::manager mgr_ro{metall::open_read_only, path};
metall::manager mgr_rw{metall::open_only, path}; // this should fail
@KIwabuchi
Copy link
Member

That's a good point. I'll work on that.

@KIwabuchi KIwabuchi self-assigned this Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants