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.

mysql/postgres: properly report entry not found

Chris Lu87d7312bf6ed
diff --git a/weed/filer/abstract_sql/abstract_sql_store.go b/weed/filer/abstract_sql/abstract_sql_store.go
index 891fe305f0..e87ecb9fb5 100644
--- a/weed/filer/abstract_sql/abstract_sql_store.go
+++ b/weed/filer/abstract_sql/abstract_sql_store.go
@@ -116,10 +116,13 @@ func (store *AbstractSqlStore) FindEntry(ctx context.Context, fullpath util.Full
dir, name := fullpath.DirAndName()
row := store.getTxOrDB(ctx).QueryRowContext(ctx, store.SqlFind, util.HashStringToLong(dir), name, dir)
+
var data []byte
if err := row.Scan(&data); err != nil {
- glog.Errorf("find %s: %v", fullpath, err)
- return nil, filer_pb.ErrNotFound
+ if err == sql.ErrNoRows {
+ return nil, filer_pb.ErrNotFound
+ }
+ return nil, fmt.Errorf("find %s: %v", fullpath, err)
}
entry := &filer.Entry{