ShiftLeftSecurity / overflowdb

ShiftLeft OverflowDB
Apache License 2.0
112 stars 21 forks source link

In extreme cases, querying based on id results in empty query results. #277

Open zhangziqiang1 opened 2 years ago

zhangziqiang1 commented 2 years ago

https://github.com/ShiftLeftSecurity/overflowdb/blob/0af4b29ea057e92a32c9186a53f4fc38f3a35dcc/core/src/main/java/overflowdb/util/NodesList.java#L74

https://github.com/ShiftLeftSecurity/overflowdb/blob/0af4b29ea057e92a32c9186a53f4fc38f3a35dcc/core/src/main/java/overflowdb/util/NodesList.java#L37

If there are two threads, one is writing the database and the other is reading the database via id. Then the reading thread can't observe the result of the writing thread. @mpollmeier

mpollmeier commented 2 years ago

Yes, that's what I would expect. There's currently no measures of any kind in place to guarantee read/write consistency and atomicity. Almost everything is optimized for fast reads.

We're working on a new storage engine which will be a bit more explicit about all this, and we will then also document these properties. The storage engine will be even more optimized for reads, but probably with better consistency constraints.