crclark / foundationdb-haskell

Haskell FFI bindings to the FoundationDB C API
https://crclark.github.io/foundationdb-haskell/
BSD 3-Clause "New" or "Revised" License
36 stars 5 forks source link

Transactions timing out on new FDB connection #39

Closed sutherlanda closed 4 years ago

sutherlanda commented 4 years ago

When connection with default db options (or modified as below), I'm not able to successfully complete a transaction. The transaction always returns CError TransactionTimedOut.

This also occurs when getting an existing key, or when trying to set a key/value.

{-# LANGUAGE OverloadedStrings #-}

import qualified FoundationDB as FDB
import Lib.Strings as Strings

options = FDB.defaultOptions { FDB.clusterFile = Just "" }

transactionConfig = FDB.defaultConfig { FDB.timeout = 3000 }

main = FDB.withFoundationDB options $ \db -> do
  print "connected"
  result <- FDB.runTransactionWithConfig transactionConfig db $ do
    let k = "foo"
    let v = "bar"
    FDB.set k v
    v' <- FDB.get k
    FDB.await v'
  print result
  print "done"
sutherlanda commented 4 years ago

We're using version 610 of the API

sutherlanda commented 4 years ago

Figured out that it was caused by a mismatch in the version of fdb we had running (6.2) and the API version (6.1). We uninstalled 6.2 and installed 6.1.13 instead, and transactions complete successfully!