hhblaze / DBreeze

C# .NET NOSQL ( key value store embedded ) ACID multi-paradigm database management system.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exception times to times

NicolasDorier opened this issue · comments

I get this exception time to time. The DB is not corrupted. (restarting the program and running again the command work)

DBreeze.Exceptions.DBreezeException was unhandled by user code
  HResult=-2146233088
  Message=Getting table "@utCoins" from the schema failed!
  Source=DBreeze
  StackTrace:
       at DBreeze.Transactions.TransactionsCoordinator.GetTable_WRITE(String tableName, Int32 transactionThreadId)
       at DBreeze.Transactions.Transaction.GetWriteTableFromBuffer(String tableName)
       at DBreeze.Transactions.Transaction.Insert[TKey,TValue](String tableName, TKey key, TValue value, Byte[]& refToInsertedValue, Boolean& WasUpdated, Boolean dontUpdateIfExists)
       at DBreeze.Transactions.Transaction.Insert[TKey,TValue](String tableName, TKey key, TValue value)
       at Stratis.Bitcoin.FullNode.Consensus.DBreezeCoinView.SaveChanges(ChainedBlock newTip, IEnumerable`1 unspentOutputs) in C:\Users\\Documents\StratisBitcoinFullNode-master (3)\StratisBitcoinFullNode-master\Stratis.Bitcoin.FullNode\Consensus\CoinViews\DBreezeCoinView.cs:line 126
       at Stratis.Bitcoin.FullNode.Consensus.CommitableCoinView.Commit() in C:\Users\\Documents\StratisBitcoinFullNode-master (3)\StratisBitcoinFullNode-master\Stratis.Bitcoin.FullNode\Consensus\CoinViews\CommitableCoinView.cs:line 157
       at Stratis.Bitcoin.FullNode.Consensus.BackgroundCommiterCoinView.<FlushAsync>b__21_0() in C:\Users\\Documents\StratisBitcoinFullNode-master (3)\StratisBitcoinFullNode-master\Stratis.Bitcoin.FullNode\Consensus\CoinViews\BackgroundCommiterCoinView.cs:line 98

It seems to happen here: https://github.com/stratisproject/StratisBitcoinFullNode/blob/master/Stratis.Bitcoin.FullNode/Consensus/CoinViews/DBreezeCoinView.cs#L126

commented

I see one mistake in your code. My advice may eliminate your problem.
If you modify more than one table in one transaction you must supply list of these tables before first modification command. So, use tx.SynchronizeTables("Coins","Chain")
after block
using(var tx = _Engine.GetTransaction())
{

if one of threads needs, inside of the transaction, to read data from the tables and it wants to be sure that till the end of transaction other threads will not modify the data, this thread must reserve tables for synchronized read.

I am not falling into this case, the writes are also never concurrent.
Is it something missing from the doc?

I am really in the "reporting" case where I don't care about modification while inserting and while reading

commented

I just see that in your code you make in one transaction inserts into 2 tables and you don't have tx.SynchronizeTables("Coins","Chain").
So what happens with "@utCoins" is hard to say, may be you can attach DBreeze in debug mode to your project and try to emulate the problem.

commented

Probably, it's your external "HDD" makes problems with reads.
So, I will close the issue until we have more evidences on other HDDs and debug info.
Also, you are the first reporter of such issue.
Re-open the ticket if and you have more information,