mrproliu commented on code in PR #992:
URL: 
https://github.com/apache/skywalking-banyandb/pull/992#discussion_r2895911045


##########
banyand/trace/snapshot.go:
##########
@@ -241,13 +242,17 @@ func (tst *tsTable) TakeFileSnapshot(dst string) error {
                destPartPath := filepath.Join(dst, filepath.Base(srcPath))
 
                if err := tst.fileSystem.CreateHardLink(srcPath, destPartPath, 
nil); err != nil {
-                       return fmt.Errorf("failed to create snapshot for part 
%d: %w", part.partMetadata.ID, err)
+                       return false, fmt.Errorf("failed to create snapshot for 
part %d: %w", part.partMetadata.ID, err)
                }
+               hasDiskParts = true
+       }
+       if !hasDiskParts {
+               return false, nil
        }

Review Comment:
   Changed to also check the `sidxMap` length to verify the snapshot should be 
created or not. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to