Skip to content

fix: Handle deletions in the tables - #15

Merged
ieQu1 merged 1 commit into
masterfrom
dev/handle-deletions
Aug 12, 2026
Merged

fix: Handle deletions in the tables#15
ieQu1 merged 1 commit into
masterfrom
dev/handle-deletions

Conversation

@ieQu1

@ieQu1 ieQu1 commented Aug 12, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Mnesia↔RocksDB table sync receiver logic to ensure the local RocksDB-backed table correctly reflects upstream deletions by clearing the receiver’s table before applying incoming sync data.

Changes:

  • Clear the receiver table once at the beginning of a table sync (and also when the upstream table is empty) so missing records are removed locally.
  • Track receiver-side sync state via a new need_clear state to ensure clearing happens exactly once.
  • Update the file header copyright notice formatting.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/mnesia_rocksdb.erl Outdated
Comment thread src/mnesia_rocksdb.erl
@ieQu1
ieQu1 force-pushed the dev/handle-deletions branch from d5fa1d4 to c5763f8 Compare August 12, 2026 12:55
Comment thread src/mnesia_rocksdb.erl Outdated
@ieQu1
ieQu1 force-pushed the dev/handle-deletions branch from c5763f8 to 6600bcd Compare August 12, 2026 13:52
@uwiger

uwiger commented Aug 12, 2026

Copy link
Copy Markdown

BTW, if you are using mnesia_rocksdb together with Distributed Mnesia, you might be interested in discussing how to evolve https://git.qpq.swiss/QPQ-AG/mnesia_rocksdb/pulls/12 - When using the rocksdb backend for very large tables, it is probably more efficient to use the rocksdb backup support, but the PR currently doesn't consider distributed databases.

(That fork of mnesia_rocksdb is being actively maintained and improved)

@ieQu1

ieQu1 commented Aug 12, 2026

Copy link
Copy Markdown
Member Author

Thanks @uwiger, I'll keep an eye on that project. But we practically don't use mnesia+rocksdb. Most of our remaining mnesia/mria tables are ram_copies; as for large volumes of persistent data we've already built something else from scratch.

@ieQu1
ieQu1 merged commit 01e6578 into master Aug 12, 2026
1 check passed
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

Successfully merging this pull request may close these issues.

4 participants