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 mysql data store bug

Chris Lu04c2c5e58d1e
diff --git a/weed/filer/mysql_store/mysql_store.go b/weed/filer/mysql_store/mysql_store.go
index 32cf8c5674..72a8bb66a9 100644
--- a/weed/filer/mysql_store/mysql_store.go
+++ b/weed/filer/mysql_store/mysql_store.go
@@ -148,10 +148,14 @@ func (s *MySqlStore) Put(fullFilePath string, fid string) (err error) {
} else {
if len(old_fid) == 0 {
err = s.insert(fullFilePath, fid, s.dbs[instance_offset], tableFullName)
- err = fmt.Errorf("MySqlStore Put operation failed when inserting path %s with fid %s : err is %v", fullFilePath, fid, err)
+ if err != nil {
+ err = fmt.Errorf("MySqlStore Put operation failed when inserting path %s with fid %s : err is %v", fullFilePath, fid, err)
+ }
} else {
err = s.update(fullFilePath, fid, s.dbs[instance_offset], tableFullName)
- err = fmt.Errorf("MySqlStore Put operation failed when updating path %s with fid %s : err is %v", fullFilePath, fid, err)
+ if err != nil {
+ err = fmt.Errorf("MySqlStore Put operation failed when updating path %s with fid %s : err is %v", fullFilePath, fid, err)
+ }
}
}
return