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

Problem: memiavl operations on multiple stores are not atomic #961

Closed
Tracked by #870
yihuang opened this issue Apr 6, 2023 · 1 comment
Closed
Tracked by #870

Problem: memiavl operations on multiple stores are not atomic #961

yihuang opened this issue Apr 6, 2023 · 1 comment

Comments

@yihuang
Copy link
Collaborator

yihuang commented Apr 6, 2023

When integrated with sdk, we need to support multiple stores in an atomic way, two potential solutions:

Treat Multiple Stores as First Class Citizen

  • The WAL should be handled in a unified way with multiple stores, so we don't end up with different latest versions with different stores
  • The snapshot rewrite should be unified with multistore as well, so the snapshot versions are consistent.

Following directory structure should make more sense, treat multistore as first class citizen in memiavl implementation:

memiavl.db
  current -> snapshot-N
  snapshot-N
    bank
      kvs
      nodes
      metadata
    acc
    ... other stores
  wal

A wal entry should include the change sets for all stores, and store upgrades (additions/renaming/deletions)

Advantages

  • easier to manage store upgrades.
  • single WAL file to manage.

Disadvantages

  • harder to integrate with the current store APIs

Store CommitInfo

Similar to current rootmulti store design in sdk, store a common commit info file which records the latest committed information for all stores, the stores must has persisted (fsync) the committed version, on crash, some stores may saved one extra version, on startup the extra version should be ignored and truncated.

Advantages

  • more natural to integrate with the current store APIs

Disadvantages

  • a dozen WAL files to manage, and have to fsync each of them before writing out the commit info.
  • tricky to manage store upgrades
@yihuang
Copy link
Collaborator Author

yihuang commented Apr 11, 2023

closed by #959

@yihuang yihuang closed this as completed Apr 11, 2023
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

1 participant