Project

General

Profile

Repo Deletion Protocol » History » Version 3

weijia yuan, 02/02/2018 04:01 PM

1 1 weijia yuan
Repo Deletion Protocol
2 2 weijia yuan
======================
3
4
Repo deletion protocol uses [[Repo Command]].
5
6 3 weijia yuan
Deletion of one content object or content objects under certain prefix are both supported in repo specification. Filters are used to select multiple content objects. These filters are different from conventional [filters](http://named-data.net/doc/ndn-tlv/interest.html#filters) of interest packet. The conventional selecors of interest would select one data packet of repo. Filters of delete command will return any data packets which applies for these filters. Deletion of segmented data is also supported.
7 2 weijia yuan
8
## Basic operations
9
10
### Deletion command interest semantics
11
12
Command verb: **delete**
13
14
Deletion command interest follows the format of the repo command. For example:
15
16
    /ucla/cs/repo/delete/<RepoCommandParameter>/<timestamp>/<random-value>/<SignatureInfo>/<SignatureValue
17
18
## Formats
19
20
### Deletion Command RepoCommandParameter
21
22 3 weijia yuan
Format of deletion command RepoCommandParameter follows that of Repo Command. Name, Filter, StartBlockId, EndBlockId, ProcessId are used to construct RepoCommandParameter.
23 2 weijia yuan
24
Name is the name or the prefix of data repo will delete.
25
26 3 weijia yuan
Filter is used to select data. ChildFilter is **not** supported in deletion command.
27 2 weijia yuan
28
StartBlockId and EndBlockId are used to delete segment data. Data of segment id between StartBlockId and EndBlockId will be deleted by repo.
29
30
ProcessId is a random number generated by client to indicate the deletion process. Repo will match this ProcessId with this deletion process.
31
32 3 weijia yuan
### Deletion Command Filters
33 2 weijia yuan
34 3 weijia yuan
Deletion command filters follows the [repo command filters](http://redmine.named-data.net/projects/repo-ng/wiki/Repo_Protocol_Specification#Repo-Command-Filters).
35 2 weijia yuan
36
### Deletion status check
37
38
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:
39
40
    /ucla/cs/repo/delete/<RepoCommandParameter>/<timestamp>/<random-value>/<SignatureInfo>/<SignatureValue>
41
42
### Deletion status check RepoCommandParameter
43
44
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.
45
46 3 weijia yuan
### Deletion Check Command Filters
47 2 weijia yuan
48 3 weijia yuan
Filters are not supported. Repo will ignore filters when processing deletion status check command.
49 2 weijia yuan
50
### Deletion status response
51
52
Deletion status response is used as response of repo deletion command and repo deletion check command.
53
54 3 weijia yuan
Name, StatusCode, Filter, StartBlockId, EndBlockId, ProcessId, DeletenNum are used in deletion status response. Name, ProcessId, Filter is the same as that of delete command. StatusCode indicates the status of deletion. DeleteNum indicates how many data packets have been deleted.
55 2 weijia yuan
56
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
57
58
StatusCode Definition:
59
60
``StatusCode`` | Description
61
-------------- | --------------------------------------
62
``200``        | All the data has been deleted
63
``300``        | This deletion is in progress
64
``401``        | This deletion or deletion check is invalidated
65 3 weijia yuan
``402``        | Filters and BlockId both present
66 2 weijia yuan
``403``        | Malformed Command
67
``404``        | No such this deletion is in progress
68
69
## Protocol process
70
71
1. start to authorize the command; if authorization does not fail, go to step 3
72
73
2. send a negative response indicating authorization failure, and abort these steps, end deletion process. (StatusCode: 401)
74
75
3. check whether a deletion process of same RepoCommandParameter exists, waiting for deletion process ends.
76
77 3 weijia yuan
4. If filters and one of StartBlockId and EndBlockId presents, send a negative response and abort these steps, end deletion process. (StatusCode: 402)
78 2 weijia yuan
79 3 weijia yuan
5. If filters present, go to step 8
80 2 weijia yuan
81
6. 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
82
83 3 weijia yuan
7. If StartBlockId, EndBlockId and filters are all missing, go to step 10
84 2 weijia yuan
85 3 weijia yuan
8. delete all the data that conforms to the name and filters, go to step 11
86 2 weijia yuan
87
9. 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
88
89
10. delete all the data with prefix same as name. got to step 11
90
91
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)
92
93
Client will set deletion command with big lifetime. If life time expires, client will re-express the command.
94
95
Implementation MAY publish a notification of status regarding delete progress. The process of status check is as follows:
96
97
1. start to authorize the delete status command
98
99
2. send a negative response indicating authorization failure, and abort these steps (StatusCode: 401)
100
101
3. 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.
102
103
4. reponse status with status code of 404 (StatusCode: 404)
104
105
5. ckeck te status of delete. return the status data content (StatusCode: 300)
106
107
### Protocol diagram:
108
109
    Requester                     Repo 
110
        |                           |                                 
111
        |                           |                                 
112
      +---+  Delete command       +---+                               
113
      |   | --------------------> |   |                               
114
      +---+                       +---+                               
115
        |                           |                                 
116
        |                           |                                 
117
        |                           |                                 
118
      +---+   Status interest     +---+                               
119
      |   | --------------------> |   |                               
120
      +---+                       |   |                               
121
        |                         |   |                               
122
      +---+    Status response    |   |                               
123
      |   | <==================== |   |                               
124
      +---+                       +---+                               
125
        |                           |                                 
126
        |                           |                                 
127
        |                           |                                 
128
      +---+   Confirm Deletion    +---+                               
129
      |   | <==================== |   |                               
130
      +---+   Reject command      +---+                               
131
        |     (with status code)    |    
132
        |                           |