Comments (4)
We should prevent concurrent read and write access to the same kuzu database from different processes, as there is no guarantee we can provide to make sure that read and write transactions from different processes are consistent.
To clarify and make sure I got this correctly: It is expected behavior that access from multiple (ro+rw) Database
objects/instances to one database directory on filesystem within the same process is not possible either (see #2934). Here is a shorter version:
import tempfile
import kuzu
with tempfile.TemporaryDirectory() as d:
conn_rw = kuzu.Connection(kuzu.Database(d))
conn_ro = kuzu.Connection(kuzu.Database(d, read_only=True))
conn_rw.execute("CREATE NODE TABLE V(id STRING,PRIMARY KEY(id));")
conn_rw.execute("CREATE (v:V {id: 'foo'}) RETURN v;")
print((conn_rw.execute("MATCH (v:V {id: 'foo'}) RETURN v;").get_next()[0]))
# {'_id': {'offset': 0, 'table': 0}, '_label': 'V', 'id': 'foo'}
print((conn_ro.execute("MATCH (v:V {id: 'foo'}) RETURN v;").get_next()[0]))
# RuntimeError: Binder exception: Table V does not exist.
I think it makes sense to provide an appropriate error here as well.
from kuzu.
hi @sapalli2989 , yes. you're right. and we should error on this too. also related to #3292.
from kuzu.
We usefcntl
to ensure the access mode to databases.
fcntl
can not add any other locks while already holding an exclusive write lock.
An exclusive or write lock gives a process exclusive access for writing to the specified part of the file. While a write lock is in place, no other process can lock that part of the file.
from kuzu.
This should be expected. The way to share the same Kuzu database among multiple processes is to open the database under READ ONLY
mode.
We should prevent concurrent read and write access to the same kuzu database from different processes, as there is no guarantee we can provide to make sure that read and write transactions from different processes are consistent. So I would suggest we don't change this behaviour. but we should document this more clearly in our docs for sure.
from kuzu.
Related Issues (20)
- Make warning limit per-query instead of per-connection
- Missing progress report for second and third pipelines in COPY REL statements
- Feature: Implement a table function to show bm statistics
- Bug: Query Performance Discrepancy: KuzuDB CLI vs. Rust Code HOT 8
- Add support for CALL function without RETURN clause
- Bug: Twice COPY FROM command causing segmentation fault
- Feature: Adding pipeline number to plan
- Feature: Report error line number when error occurs in the json reader.
- More test coverage on multi-label rel scan
- Feature: Full text search
- Bug: ldbc sf01 deleteComment test fail randomly
- Optimization: Join order optimization across match/load from clauses
- Kรนzu to NetworkX fails when results of an HOT 1
- GDS and Recursive Joins TODOs
- Bug: PROJECT graph does not error when projecting graphs without the right node/rel tables
- Bug: Matching ; within strings to end of command
- Remove RDF support
- Bug: Skip comment lines in csv files
- Bug: string being treated as regexp in regexp functions
- Feature: Add Support for Exporting Graphs to graph-tool
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kuzu.