Our go client hang when writing data to foundationdb, the stack is:
How could this happen? The status of fdb says ‘Healthy (Rebalancing)’
How to analyze this situation?
Thanks a lot.
Our go client hang when writing data to foundationdb, the stack is:
How could this happen? The status of fdb says ‘Healthy (Rebalancing)’
How to analyze this situation?
Thanks a lot.
You didn’t provide much details. Can you share the code?
Here is an example code for writing in
package main
import (
"strconv"
"time"
"github.com/apex/log"
"github.com/apple/foundationdb/bindings/go/src/fdb"
"github.com/apple/foundationdb/bindings/go/src/fdb/directory"
"github.com/apple/foundationdb/bindings/go/src/fdb/tuple"
)
func main() {
// Different API versions may expose different runtime behaviors.
fdb.MustAPIVersion(610)
// Open the default database from the system cluster
db, err := fdb.Open("./fdb.cluster", []byte("DB"))
if err != nil {
panic(err)
}
spiderDir, err := directory.CreateOrOpen(db, []string{"test"}, nil)
if err != nil {
panic(err)
}
facebookSub := spiderDir.Sub("sub")
id := "2089982715568013122"
_, err = db.Transact(func(tr fdb.Transaction) (ret interface{}, err error) {
tr.Set(facebookSub.Pack(tuple.Tuple{"test", id}), []byte(strconv.FormatInt(time.Now().UnixNano(), 10)))
return
})
if err != nil {
log.Errorf("not good: %v", err)
}
}
This also sounds a bit odd, as calling set()
doesn’t involve any network communication (the key-value pair is just buffered locally), would would more strongly suggest some local issue.
Thanks, I will check the local code.