dropping from clusters
Dropping from a cluster drops from every node of the cluster. Including nodes that the cluster does not think have the content. This is different from GET and CHECKPRESENT, which do trust the cluster's location log. The difference is that removing from a cluster should make 100% the content is gone from every node. So doing extra work is ok. Compare with CHECKPRESENT where checking every node could make it very expensive, and the worst that can happen in a false negative is extra work being done. Extended the P2P protocol with FAILURE-PLUS to handle the case where a drop from one node succeeds, but a drop from another node fails. In that case the entire cluster drop has failed. Note that SUCCESS-PLUS is returned when dropping from a proxied remote that is not a cluster, when the protocol version supports it. This is because P2P.Proxy does not know when it's proxying for a single node cluster vs for a remote that is not a cluster.
This commit is contained in:
parent
a6a04b7e5e
commit
5b332a87be
14 changed files with 144 additions and 59 deletions
|
@ -205,7 +205,7 @@ doDrop pcc dropfrom contentlock key afile numcopies mincopies skip preverified c
|
|||
ifM (Annex.getRead Annex.force)
|
||||
( dropaction Nothing
|
||||
, ifM (checkRequiredContent pcc dropfrom key afile)
|
||||
( verifyEnoughCopiesToDrop nolocmsg key
|
||||
( verifyEnoughCopiesToDrop nolocmsg key (Just dropfrom)
|
||||
contentlock numcopies mincopies
|
||||
skip preverified check
|
||||
(dropaction . Just)
|
||||
|
|
|
@ -108,7 +108,8 @@ getKey' key afile = dispatch
|
|||
Remote.showTriedRemotes remotes
|
||||
showlocs (map Remote.uuid remotes)
|
||||
return False
|
||||
showlocs exclude = Remote.showLocations False key exclude
|
||||
showlocs exclude = Remote.showLocations False key
|
||||
(\u -> pure (u `elem` exclude))
|
||||
"No other repository is known to contain the file."
|
||||
-- This check is to avoid an ugly message if a remote is a
|
||||
-- drive that is not mounted.
|
||||
|
|
|
@ -319,7 +319,7 @@ verifyExisting key destfile (yes, no) = do
|
|||
(needcopies, mincopies) <- getFileNumMinCopies destfile
|
||||
|
||||
(tocheck, preverified) <- verifiableCopies key []
|
||||
verifyEnoughCopiesToDrop [] key Nothing needcopies mincopies [] preverified tocheck
|
||||
verifyEnoughCopiesToDrop [] key Nothing Nothing needcopies mincopies [] preverified tocheck
|
||||
(const yes) no
|
||||
|
||||
seekRemote :: Remote -> Branch -> Maybe TopFilePath -> Bool -> CheckGitIgnore -> [String] -> CommandSeek
|
||||
|
|
|
@ -193,7 +193,7 @@ toPerform' mcontentlock dest removewhen key afile fastcheck isthere = do
|
|||
DropCheckNumCopies -> do
|
||||
(numcopies, mincopies) <- getSafestNumMinCopies afile key
|
||||
(tocheck, verified) <- verifiableCopies key [srcuuid]
|
||||
verifyEnoughCopiesToDrop "" key (Just contentlock)
|
||||
verifyEnoughCopiesToDrop "" key (Just srcuuid) (Just contentlock)
|
||||
numcopies mincopies [srcuuid] verified
|
||||
(UnVerifiedRemote dest : tocheck)
|
||||
(drophere setpresentremote contentlock . showproof)
|
||||
|
@ -299,7 +299,7 @@ fromDrop src destuuid deststartedwithcopy key afile adjusttocheck =
|
|||
DropCheckNumCopies -> do
|
||||
(numcopies, mincopies) <- getSafestNumMinCopies afile key
|
||||
(tocheck, verified) <- verifiableCopies key [Remote.uuid src]
|
||||
verifyEnoughCopiesToDrop "" key Nothing numcopies mincopies [Remote.uuid src] verified
|
||||
verifyEnoughCopiesToDrop "" key (Just (Remote.uuid src)) Nothing numcopies mincopies [Remote.uuid src] verified
|
||||
(adjusttocheck tocheck) (dropremote . showproof) faileddropremote
|
||||
DropWorse -> faileddropremote
|
||||
where
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue