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

Disallowing multiple Database instances (e.g., from multiple processes) running on the same database directory #921

Open
semihsalihoglu-uw opened this issue Nov 5, 2022 · 2 comments
Assignees
Labels
feature New features or missing components of existing features

Comments

@semihsalihoglu-uw
Copy link
Contributor

semihsalihoglu-uw commented Nov 5, 2022

Currently we do not have a mechanism to block multiple Database instances to be , i.e., multiple embedded Kuzu instances running on the same database directory. This should not be allowed as long as we do not have a mechanism to make Database instances read-only. This is because this leads to the following problem if these processes are allowed to write.

Suppose there are 2 separate OS processes: P1 and P2 running Kuzu:

  • P1 writes something to the database. For example adds a new User node. Suppose there was 5 User nodes before. Now there is 6.
  • P2 will not be able to see this write because parts of the database data, e.g., catalog or node_statistics_and_deleted_ids, as always kept in memory and there is no mechanism for P2 to know that these parts have been modified, and refresh them. In this example, there is no way for P2 to know that node_statistics_and_deleted_ids have been modified. So it will think that there are still 5 User nodes.

Probably the most common case this would appear is if there are 2 separate OS processes running Kuzu but this is not really about number of processes. This is about number of Database instances. Database here refers to the object in program lines like this: auto database = make_unique<Database>(*databaseConfig, *systemConfig);.

We should add a note about this to the documentation's Client APIs and solve this immediately after phase 1 release.

@semihsalihoglu-uw semihsalihoglu-uw added the testing Testing related issues label Nov 5, 2022
@semihsalihoglu-uw semihsalihoglu-uw changed the title Disallowing multiple processes running on the same database directory Disallowing multiple Database instances (e.g., from multiple processes) running on the same database directory Nov 5, 2022
@ray6080 ray6080 added feature New features or missing components of existing features and removed testing Testing related issues labels Oct 9, 2023
@ray6080 ray6080 assigned hououou and unassigned ray6080, andyfengHKU and acquamarin Oct 9, 2023
@Riolku
Copy link
Contributor

Riolku commented Oct 17, 2023

Is this complete now then?

@mewim
Copy link
Member

mewim commented Oct 17, 2023

I think this does not work for Windows for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New features or missing components of existing features
Projects
None yet
Development

No branches or pull requests

7 participants