Repo Deletion Protocol¶
Repo deletion protocol uses Repo Command.
Deletion of one content object or content objects under certain prefix are both supported in repo specification. Selectors are used to select multiple content objects. These selectors are different from conventional selectors of interest packet. The conventional selecors of interest would select one data packet of repo. Selectors of delete command will return any data packets which applies for these selectors. Deletion of segmented data is also supported.
Deletion command interest semantics¶
Command verb: delete
Deletion command interest follows the format of the repo command. For example:
Deletion Command RepoCommandParameter¶
Format of deletion command RepoCommandParameter follows that of Repo Command. Name, Selector, StartBlockId, EndBlockId, ProcessId are used to construct RepoCommandParameter.
Name is the name or the prefix of data repo will delete.
Selector is used to select data. ChildSelector is not supported in deletion command.
StartBlockId and EndBlockId are used to delete segment data. Data of segment id between StartBlockId and EndBlockId will be deleted by repo.
ProcessId is a random number generated by client to indicate the deletion process. Repo will match this ProcessId with this deletion process.
Deletion Command Selectors¶
Deletion command selectors follows the repo command selectors.
Deletion status check¶
During the deletion progress, the requester could send deletion status check command to check the status of the deletion progress. This status check command is also signed interest. The semantics of deletion status check command follows the format of repo command.
<command verb> equals to
delete check. For example:
Deletion status check RepoCommandParameter¶
Name and ProcessId are used to indicate certain deletion process. Repo uses Name and ProcessId to match certain deletion process. If it matches, repo will respond progress of deletion. If just one of Name or ProcessId matches, it fails.
Deletion Check Command Selectors¶
Selectors are not supported. Repo will ignore selectors when processing deletion status check command.
Deletion status response¶
Deletion status response is used as response of repo deletion command and repo deletion check command.
Name, StatusCode, Selector, StartBlockId, EndBlockId, ProcessId, DeletenNum are used in deletion status response. Name, ProcessId, Selector is the same as that of delete command. StatusCode indicates the status of deletion. DeleteNum indicates how many data packets have been deleted.
In Repo Deletion Command, if just StartBlockId presents, EndBlockId may be the largest segment ID repo holds. If just EndBlockId presents, StartBlockId will be set 0
||All the data has been deleted|
||This deletion is in progress|
||This deletion or deletion check is invalidated|
||Selectors and BlockId both present|
||No such this deletion is in progress|
start to authorize the command; if authorization does not fail, go to step 3
send a negative response indicating authorization failure, and abort these steps, end deletion process. (StatusCode: 401)
check whether a deletion process of same RepoCommandParameter exists, waiting for deletion process ends.
If selectors and one of StartBlockId and EndBlockId presents, send a negative response and abort these steps, end deletion process. (StatusCode: 402)
If selectors present, go to step 8
check whether StartBlockId or EndBlockId presents. If both presents but StartBlockId is larger than EndBlockId, return negative response and end deletion process. (StatusCode: 403) Or go to step 9
If StartBlockId, EndBlockId and selectors are all missing, go to step 10
delete all the data that conforms to the name and selectors, go to step 11
delete all the data packets of segment id between StartBlockId and EndBlockId. If StartBlockId is missing, StartBlockId is set to be 0. If EndBlockId is missing, EndBlockId is set to be the largest segment id that repo holds. go to step 11
delete all the data with prefix same as name. got to step 11
If lifetime of interest does not expire, return status response of positive statuscode. If lifetime of interest has expired, wait for interest the same RepoCommandParameter and return this status response. End Deletion process. (StatusCode: 200)
Client will set deletion command with big lifetime. If life time expires, client will re-express the command.
Implementation MAY publish a notification of status regarding delete progress. The process of status check is as follows:
start to authorize the delete status command
send a negative response indicating authorization failure, and abort these steps (StatusCode: 401)
start to check the progress of the delete with the data name in the command. If no such progress is found, go to 4. or go to 5.
reponse status with status code of 404 (StatusCode: 404)
ckeck te status of delete. return the status data content (StatusCode: 300)
Requester Repo | | | | +---+ Delete command +---+ | | --------------------> | | +---+ +---+ | | | | | | +---+ Status interest +---+ | | --------------------> | | +---+ | | | | | +---+ Status response | | | | <==================== | | +---+ +---+ | | | | | | +---+ Confirm Deletion +---+ | | <==================== | | +---+ Reject command +---+ | (with status code) | | |