meilisearch / meilisearch/heed
Make transaction opening more safe
@Kerollmops is already working on this.
Since Oct 28, 2019.
- Dominant language
- Rust
- Stars
- 914
- Forks
- 82
- PR merge metrics
- No merged PRs in 30d
Description
Heed could ensure that only one write transaction is ever opened on the same thread.
It can create a thread_local atomic counter for write transactions and raise an error (panic or not) when the user try to open a write transaction and another one is already open.
According to the LMDB documentation, there must never be more than one transaction on the same thread at any time. We could ensure that when we call the read/write_txn function and write into a global variable to check that no other transaction is already opened.
A thread can only use one transaction at a time, plus any child transactions. Each transaction belongs to one thread. See below. The MDB_NOTLS flag changes this for read-only transactions.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.