Revert "rename: delete source entry metadata only, skipping hard links"

This reverts commit 03466f955e.

fix https://github.com/seaweedfs/seaweedfs/issues/3386
This commit is contained in:
chrislu
2022-07-31 22:51:41 -07:00
parent 5fbe437ee9
commit 303bd067b5
5 changed files with 7 additions and 36 deletions

View File

@@ -65,7 +65,7 @@ func (mc *MetaCache) doInsertEntry(ctx context.Context, entry *filer.Entry) erro
return mc.localStore.InsertEntry(ctx, entry)
}
func (mc *MetaCache) AtomicUpdateEntryFromFiler(ctx context.Context, oldPath util.FullPath, newEntry *filer.Entry, shouldDeleteChunks bool) error {
func (mc *MetaCache) AtomicUpdateEntryFromFiler(ctx context.Context, oldPath util.FullPath, newEntry *filer.Entry) error {
//mc.Lock()
//defer mc.Unlock()
@@ -77,14 +77,8 @@ func (mc *MetaCache) AtomicUpdateEntryFromFiler(ctx context.Context, oldPath uti
// leave the update to the following InsertEntry operation
} else {
glog.V(3).Infof("DeleteEntry %s", oldPath)
if shouldDeleteChunks {
if err := mc.localStore.DeleteEntry(ctx, oldPath); err != nil {
return err
}
} else {
if err := mc.localStore.DeleteOneEntrySkipHardlink(ctx, oldPath); err != nil {
return err
}
if err := mc.localStore.DeleteEntry(ctx, oldPath); err != nil {
return err
}
}
}
@@ -121,12 +115,6 @@ func (mc *MetaCache) FindEntry(ctx context.Context, fp util.FullPath) (entry *fi
return
}
func (mc *MetaCache) DeleteEntrySkipHardlink(ctx context.Context, fp util.FullPath) (err error) {
//mc.Lock()
//defer mc.Unlock()
return mc.localStore.DeleteOneEntrySkipHardlink(ctx, fp)
}
func (mc *MetaCache) DeleteEntry(ctx context.Context, fp util.FullPath) (err error) {
//mc.Lock()
//defer mc.Unlock()