diff --git a/test/foundationdb/docker-compose.arm64.yml b/test/foundationdb/docker-compose.arm64.yml index 683c967d1..9eda8db42 100644 --- a/test/foundationdb/docker-compose.arm64.yml +++ b/test/foundationdb/docker-compose.arm64.yml @@ -154,7 +154,7 @@ services: WEED_LEVELDB2_ENABLED: "false" WEED_FOUNDATIONDB_ENABLED: "true" WEED_FOUNDATIONDB_CLUSTER_FILE: "/var/fdb/config/fdb.cluster" - WEED_FOUNDATIONDB_API_VERSION: "720" + WEED_FOUNDATIONDB_API_VERSION: "740" WEED_FOUNDATIONDB_TIMEOUT: "5s" WEED_FOUNDATIONDB_MAX_RETRY_DELAY: "1s" WEED_MASTER_VOLUME_GROWTH_COPY_1: 1 diff --git a/weed/filer/foundationdb/CONFIGURATION.md b/weed/filer/foundationdb/CONFIGURATION.md index f4a73afe0..80f5bd357 100644 --- a/weed/filer/foundationdb/CONFIGURATION.md +++ b/weed/filer/foundationdb/CONFIGURATION.md @@ -23,7 +23,7 @@ All configuration options can be set via environment variables with the `WEED_FO ```bash export WEED_FOUNDATIONDB_ENABLED=true export WEED_FOUNDATIONDB_CLUSTER_FILE=/etc/foundationdb/fdb.cluster -export WEED_FOUNDATIONDB_API_VERSION=720 +export WEED_FOUNDATIONDB_API_VERSION=740 export WEED_FOUNDATIONDB_TIMEOUT=5s export WEED_FOUNDATIONDB_MAX_RETRY_DELAY=1s export WEED_FOUNDATIONDB_DIRECTORY_PREFIX=seaweedfs @@ -274,7 +274,7 @@ location = "/backup" # Docker environment WEED_FOUNDATIONDB_ENABLED=true WEED_FOUNDATIONDB_CLUSTER_FILE=/var/fdb/config/fdb.cluster -WEED_FOUNDATIONDB_API_VERSION=720 +WEED_FOUNDATIONDB_API_VERSION=740 ``` ### Kubernetes ConfigMap diff --git a/weed/filer/foundationdb/INSTALL.md b/weed/filer/foundationdb/INSTALL.md index 101097a8e..7b3b128fa 100644 --- a/weed/filer/foundationdb/INSTALL.md +++ b/weed/filer/foundationdb/INSTALL.md @@ -135,7 +135,7 @@ Alternative configuration via environment variables: ```bash export WEED_FOUNDATIONDB_ENABLED=true export WEED_FOUNDATIONDB_CLUSTER_FILE=/etc/foundationdb/fdb.cluster -export WEED_FOUNDATIONDB_API_VERSION=720 +export WEED_FOUNDATIONDB_API_VERSION=740 export WEED_FOUNDATIONDB_TIMEOUT=5s export WEED_FOUNDATIONDB_MAX_RETRY_DELAY=1s export WEED_FOUNDATIONDB_DIRECTORY_PREFIX=seaweedfs diff --git a/weed/filer/foundationdb/README.md b/weed/filer/foundationdb/README.md index cde3e00b5..68ba6416a 100644 --- a/weed/filer/foundationdb/README.md +++ b/weed/filer/foundationdb/README.md @@ -71,7 +71,7 @@ Configure via environment variables: ```bash export WEED_FOUNDATIONDB_ENABLED=true export WEED_FOUNDATIONDB_CLUSTER_FILE=/etc/foundationdb/fdb.cluster -export WEED_FOUNDATIONDB_API_VERSION=720 +export WEED_FOUNDATIONDB_API_VERSION=740 export WEED_FOUNDATIONDB_TIMEOUT=5s export WEED_FOUNDATIONDB_MAX_RETRY_DELAY=1s export WEED_FOUNDATIONDB_DIRECTORY_PREFIX=seaweedfs diff --git a/weed/filer/foundationdb/foundationdb_store.go b/weed/filer/foundationdb/foundationdb_store.go index d9c2925ee..23f53c3e0 100644 --- a/weed/filer/foundationdb/foundationdb_store.go +++ b/weed/filer/foundationdb/foundationdb_store.go @@ -381,6 +381,7 @@ func (store *FoundationDBStore) ListDirectoryPrefixedEntries(ctx context.Context for _, kv := range kvs { fileName := store.extractFileName(kv.Key) if fileName == "" { + glog.V(0).Infof("list %s: failed to extract fileName from key %v", dirPath, kv.Key) continue } @@ -447,6 +448,9 @@ func (store *FoundationDBStore) KvGet(ctx context.Context, key []byte) ([]byte, } if err != nil || len(data) == 0 { + if err != nil { + glog.V(2).Infof("KvGet error for key %v: %v", key, err) + } return nil, filer.ErrKvNotFound } @@ -489,12 +493,18 @@ func (store *FoundationDBStore) genDirectoryKeyPrefix(dirPath, prefix string) fd func (store *FoundationDBStore) extractFileName(key fdb.Key) string { t, err := store.seaweedfsDir.Unpack(key) - if err != nil || len(t) < 2 { + if err != nil { + glog.V(4).Infof("extractFileName: unpack error for key %v: %v", key, err) + return "" + } + if len(t) < 2 { + glog.V(4).Infof("extractFileName: tuple too short (len=%d) for key %v", len(t), key) return "" } if fileName, ok := t[1].(string); ok { return fileName } + glog.V(4).Infof("extractFileName: second element not a string (type=%T) for key %v", t[1], key) return "" } diff --git a/weed/filer/foundationdb/foundationdb_store_test.go b/weed/filer/foundationdb/foundationdb_store_test.go index 69bc0c156..f76fa57df 100644 --- a/weed/filer/foundationdb/foundationdb_store_test.go +++ b/weed/filer/foundationdb/foundationdb_store_test.go @@ -20,7 +20,7 @@ func TestFoundationDBStore_Initialize(t *testing.T) { // Test with default configuration config := util.GetViper() config.Set("foundationdb.cluster_file", getTestClusterFile()) - config.Set("foundationdb.api_version", 630) + config.Set("foundationdb.api_version", 740) store := &FoundationDBStore{} err := store.Initialize(config, "foundationdb.") @@ -42,7 +42,7 @@ func TestFoundationDBStore_Initialize(t *testing.T) { func TestFoundationDBStore_InitializeWithCustomConfig(t *testing.T) { config := util.GetViper() config.Set("foundationdb.cluster_file", getTestClusterFile()) - config.Set("foundationdb.api_version", 630) + config.Set("foundationdb.api_version", 740) config.Set("foundationdb.timeout", "10s") config.Set("foundationdb.max_retry_delay", "2s") config.Set("foundationdb.directory_prefix", "custom_prefix") @@ -118,7 +118,7 @@ func TestFoundationDBStore_InitializeInvalidConfig(t *testing.T) { func TestFoundationDBStore_KeyGeneration(t *testing.T) { store := &FoundationDBStore{} - err := store.initialize(getTestClusterFile(), 720) + err := store.initialize(getTestClusterFile(), 740) if err != nil { t.Skip("FoundationDB not available for testing, skipping") } @@ -158,7 +158,7 @@ func TestFoundationDBStore_KeyGeneration(t *testing.T) { func TestFoundationDBStore_DirectoryKeyPrefix(t *testing.T) { store := &FoundationDBStore{} - err := store.initialize(getTestClusterFile(), 720) + err := store.initialize(getTestClusterFile(), 740) if err != nil { t.Skip("FoundationDB not available for testing, skipping") } @@ -187,7 +187,7 @@ func TestFoundationDBStore_DirectoryKeyPrefix(t *testing.T) { func TestFoundationDBStore_ErrorHandling(t *testing.T) { store := &FoundationDBStore{} - err := store.initialize(getTestClusterFile(), 720) + err := store.initialize(getTestClusterFile(), 740) if err != nil { t.Skip("FoundationDB not available for testing, skipping") } @@ -227,7 +227,7 @@ func TestFoundationDBStore_ErrorHandling(t *testing.T) { func TestFoundationDBStore_TransactionState(t *testing.T) { store := &FoundationDBStore{} - err := store.initialize(getTestClusterFile(), 720) + err := store.initialize(getTestClusterFile(), 740) if err != nil { t.Skip("FoundationDB not available for testing, skipping") }