Closed tieugene closed 3 years ago
Could you tell me the command line to reproduce the issue?
Does this seem OK?
$, /tk_main -f casket.tkt -v 22 Playing 4194304 records:
Does this seem OK?
Yes, it is OK. Very slow (as for 4M records), but works correctly. Database type depends on filename extension. Bug is reproducing with *.tks
BTW, .tks is the suffix for SkipDB (skip list database). .tkt is for TreeDB (B+ tree database). So, this issue is about SkipDB right?
BTW, SkipDBM is not a mere key/value storage. It's more like "SSTable" for some cloud storages. Storing records in SkipDBM is NOT visible until you call the synchronize method. Therefore, calling Set method twice with the same key before Synchronize doesn't cause DUPLICATION_ERROR. Moreover, SkipDBM can contain multiple records with the same key. How to solve such duplications is determined by the Reducer given to Synchronize.
SkipDBM dbm; dbm.Open(...); dbm.Set("a", "first"); -> SUCCESS dbm.Get("a", ...) -> NOT_FOUND_ERROR dbm.Set("a", "second", false); -> SUCCESS dbm.Synchronize(...); -> By default, all values are kept. So, now "a" has both "first" and "second" dbm.Get("a", ...) -> SUCCESS, "first" is retrieved dbm.Set("a", "third", false); -> DUPLICATION_ERROR, because "a" with "first" and "second" are visible
BTW, .tks is the suffix for SkipDB (skip list database). .tkt is for TreeDB (B+ tree database). So, this issue is about SkipDB right?
Oops, sorry, you are right and I am not. Fixed
BTW, SkipDBM is not a mere key/value storage. It's more like "SSTable" for some cloud storages. Storing records in SkipDBM is NOT visible until you call the synchronize method.
But in my case Get(), Ask() and Try() is calling after db->Synchronize() (Look at line Sync...
after Add
).
And keys are not visible yet.
30 апр. 2021 г., в 03:09, Mikio Hirabayashi @.***> написал(а): Could you tell me the command line to reproduce the issue?
I use devel
branch, so output differs from your's.
bash-5.0$ ./kvtest_tk -v -t 3 -f test.tks 20 Playing 2**20 = 1048576 records:
You are right - Get ok, Ask find 50%. And Try (get or add) find 35..50%
If it is not bug but feature - bug report can be closed. With «WARNING!» in documentation
by design
I created testing application to compare misc key-value storages. And found strange bug in SkipDBM. There are 2 logs in attaches - tkh.log and tks.log (for HashDBM and TreeDBM respectively). Pay attention to
Ask
andTry
sections. 1st of them tries to find known or unknown keys, 2nd - try to find known or add new records. The feature is that both of them have to find known keys exactly in 50% cases (± 1 record). Seems SkipDBM cannot find some just added keys. tkh.log tks.log tkrzw-0.9.7..8PS. another SkipDBM bug will be further.