mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-24 23:10:41 +02:00
filer: hand uploaded chunks back on WORM rejection in saveMetaData
The locked recheck discarded uncommittedChunks, so a rejected write left its uploaded chunks behind; return them so callers delete them.
This commit is contained in:
1 parent
e144503caf
commit
84e227dbc3
1 file changed
+2
-2
@@ -322,9 +322,9 @@ func (fs *FilerServer) saveMetaData(ctx context.Context, r *http.Request, fileNa
|
||||
|
||||
// recheck under the lock: WORM may have been enabled during the upload
|
||||
if enforced, wormErr := fs.wormEnforcedForEntry(ctx, path); wormErr != nil {
|
||||
return nil, wormErr, nil
|
||||
return nil, wormErr, uncommittedChunks
|
||||
} else if enforced {
|
||||
return nil, errors.New(constants.ErrMsgOperationNotPermitted), nil
|
||||
return nil, errors.New(constants.ErrMsgOperationNotPermitted), uncommittedChunks
|
||||
}
|
||||
|
||||
inlineAppendHandled := false
|
||||
|
||||
Reference in new issue
Block a user