metall icon indicating copy to clipboard operation
metall copied to clipboard

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

Open liss-h opened this issue 1 year ago • 1 comments

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

liss-h avatar Feb 07 '25 09:02 liss-h

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

KIwabuchi avatar Feb 14 '25 03:02 KIwabuchi

~~Thanks for merging my PR, would you mind creating a release?~~

liss-h avatar Jun 26 '25 06:06 liss-h

Nevermind I found a bug, I will create a PR to fix it

liss-h avatar Jun 26 '25 08:06 liss-h

https://github.com/LLNL/metall/pull/355

liss-h avatar Jun 26 '25 09:06 liss-h

Hi @KIwabuchi, would you mind creating a new release now that all PRs are merged?

liss-h avatar Jul 17 '25 07:07 liss-h

@liss-h I'm working on some code clean up now. I'll try to release a new version today.

KIwabuchi avatar Jul 17 '25 17:07 KIwabuchi

Released a new version: https://github.com/LLNL/metall/releases/tag/v0.32

KIwabuchi avatar Jul 18 '25 04:07 KIwabuchi

thanks

liss-h avatar Jul 23 '25 06:07 liss-h