FoundationDb: What is meaning of FDBException: Transaction is too old to perform reads or be committed

860 Views Asked by At

I am trying to execute a getRange command in fdbCli but it fails with FDBException: Transaction is too old to perform reads or be committed What is the meaning of this particular exception? Does it mean by query took more than 5 sec to complete?

2

There are 2 best solutions below

0
On BEST ANSWER

Fdb keeps a list of the transaction started within 5 sec. Also, data nodes only keep versions of the last 5sec. So if the read version is smaller than the last version kept by dataNodes, the dataNodes have no way to answer the request. That's why fdb throws this exception. the trick to evade from such exceptions is to split one huge time taking transaction to many small transactions. I also noticed fdb performs really well if the transaction time < 300ms.

0
On

Firstly - yes, you are correct (your query took more than 5 seconds to complete).

If the read request’s timestamp is older than 5 seconds, the storage server may have already flushed the data from its in-memory multi-version data structure to its on-disk single-version data structure. This means the storage server does not have the data older than the 5 seconds. So the client will receive the error you've mentioned.

NB: You can avoid this problem via the use of a RecordCursor and by using passing a continuation to your query.

More on continuations here.