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

lock files in post data directory when accessing #204

Open
fasmat opened this issue Jul 28, 2023 · 0 comments
Open

lock files in post data directory when accessing #204

fasmat opened this issue Jul 28, 2023 · 0 comments
Assignees

Comments

@fasmat
Copy link
Member

fasmat commented Jul 28, 2023

Description

At the moment no checks are in place that prevent multiple processes (go-spacemesh, postcli, etc.) from accessing the same data directory simultaneously. This can be dangerous, especially if at least one of those processes is modifying the data (resizing, initializing, etc.). post should be updated such that only one process can access the dataDir at a time.

Acceptance criteria

  • A file lock protects access to the dataDir
  • Multiple processes that access the data read-only may do that simultaneously (i.e. a running node and verifying data integrity with postcli)
  • Multiple processes that modify/update data must not be able to access the dataDir at the same time. At most once process should be able to get an exclusive lock while the others should communicate an error to the user that a different process is accessing the data at the moment (e.g. postcli cannot modify the dataDir while the node is running)
  • Consider if long running processes that modify data (e.g. postcli init, postcli resize) do that in a manner that allows reading processes to access existing data.
    • For instance initialization / resize could create new files in a sub directory while a node is running and inform the user to shut down the node just for the last step where the newly created files are moved to the main directory and the metadata is updated.
@fasmat fasmat self-assigned this Jul 28, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Dev team kanban Jul 28, 2023
@fasmat fasmat moved this from 📋 Backlog to 🔖 Next in Dev team kanban Jul 28, 2023
@fasmat fasmat moved this from 🔖 Next to 🏗 Doing in Dev team kanban Aug 2, 2023
@fasmat fasmat moved this from 🏗 Doing to On Hold in Dev team kanban Sep 18, 2023
@dshulyak dshulyak moved this from On Hold to 📋 Backlog in Dev team kanban Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant