Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

fix ls, onBucketDelete still not triggering

eleebeb406bbbb5e
diff --git a/weed/filer/arangodb/arangodb_store.go b/weed/filer/arangodb/arangodb_store.go
index d27799b0ec..27ed9132bf 100644
--- a/weed/filer/arangodb/arangodb_store.go
+++ b/weed/filer/arangodb/arangodb_store.go
@@ -292,7 +292,7 @@ func (store *ArangodbStore) ListDirectoryEntries(ctx context.Context, dirPath ut
}
func (store *ArangodbStore) ListDirectoryPrefixedEntries(ctx context.Context, dirPath util.FullPath, startFileName string, includeStartFile bool, limit int64, prefix string, eachEntryFunc filer.ListEachEntryFunc) (lastFileName string, err error) {
- targetCollection, err := store.extractBucketCollection(ctx, dirPath)
+ targetCollection, err := store.extractBucketCollection(ctx, dirPath+"/")
if err != nil {
return lastFileName, err
}
diff --git a/weed/filer/arangodb/helpers.go b/weed/filer/arangodb/helpers.go
index c91ef2be5c..943189781d 100644
--- a/weed/filer/arangodb/helpers.go
+++ b/weed/filer/arangodb/helpers.go
@@ -48,15 +48,28 @@ func arrayToBytes(xs []uint64) []byte {
return out[:first]
}
-// gets the bucket name out of filepath
+// gets the collection the bucket points to from filepath
+func (store *ArangodbStore) extractBucketCollection(ctx context.Context, fullpath util.FullPath) (c driver.Collection, err error) {
+ bucket, _ := extractBucket(fullpath)
+ if bucket == "" {
+ bucket = DEFAULT_COLLECTION
+ }
+ c, err = store.ensureBucket(ctx, bucket)
+ if err != nil {
+ return nil, err
+ }
+ return c, err
+}
+
+// called by extractBucketCollection
func extractBucket(fullpath util.FullPath) (string, string) {
if !strings.HasPrefix(string(fullpath), BUCKET_PREFIX+"/") {
return "", string(fullpath)
}
- if strings.Count(string(fullpath), "/") < 2 {
+ if strings.Count(string(fullpath), "/") < 3 {
return "", string(fullpath)
}
- bucketAndObjectKey := string(fullpath)[len("/buckets/"):]
+ bucketAndObjectKey := string(fullpath)[len(BUCKET_PREFIX+"/"):]
t := strings.Index(bucketAndObjectKey, "/")
bucket := bucketAndObjectKey
shortPath := "/"
@@ -67,19 +80,6 @@ func extractBucket(fullpath util.FullPath) (string, string) {
return bucket, shortPath
}
-// gets the collection the bucket points to from filepath
-func (store *ArangodbStore) extractBucketCollection(ctx context.Context, fullpath util.FullPath) (c driver.Collection, err error) {
- bucket, _ := extractBucket(fullpath)
- if bucket == "" {
- bucket = DEFAULT_COLLECTION
- }
- c, err = store.ensureBucket(ctx, bucket)
- if err != nil {
- return nil, err
- }
- return c, err
-}
-
// get bucket collection from cache. if not exist, creates the buckets collection and grab it
func (store *ArangodbStore) ensureBucket(ctx context.Context, bucket string) (bc driver.Collection, err error) {
var ok bool