Closed cschuchardt88 closed 12 months ago
If you can provide a stand alone repro, we can look into it.
Problem with reproducing the error is the application is a plugin for a blockchain that uses faster as storage, that i'm making.
Sessions are not multi-thread safe? I think that is the cause of the error, plus the hanging of the session. What I have is two different threads on the same session. One thread importing blockchain data (just upserting) and the other thread reading data. At some point the session im guessing is locking up and sometimes i get that error like above comment. Also the import is slow compared to leveldb or rocksdb. But i think it has to do with my seek
function. Maybe you can point me in the right direction for getting optimal speed and disk persistence. It's very hard for someone new starting out. I read all the samples, but don't really understand what faster is doing. Plus code commits and documentation is are very generic.
Here is the code i found to work without the error. Each method can be called on another thread at any giving time. So i created a session at method level instead of using the session at class level, that fixed the error and stopped the hanging of the session. Maybe you point me in the right start direction for optimal speed and disk persistence. thank you https://github.com/cschuchardt88/neo-modules/blob/FasterDBStore/src/FasterDBStore/FasterStore.cs
Sessions are mono-threaded. You can use a pool of sessions to avoid two threads using the same session.
Example: https://github.com/microsoft/FASTER/blob/main/cs/playground/AsyncStress/SerializedFasterWrapper.cs
thank you that works. But still slow only 9-10 blocks per second compared to leveldb which is 50-100 blocks a sec. Has to do with seeking through the whole database then ordering them. Faster needs some kind of seek function for seeking forward and backwards on keys. thanks again for the help.
Correct, FASTER does not include a range index. It is designed for point reads, upserts, read-modify-writes, and full scans.
is there anything that i can hook into; so i can order the keys? Or what do you recommend i do for seeking/ordering keys in faster?
When I keep
Upsert
over and over again i get the following errorSystem.ArgumentOutOfRangeException: 'Non-negative number required. (Parameter 'count')'
It happens at random. Now i am calling a session on multiple threads for reading.Call Stack