Project

General

Profile

Repo Deletion Protocol » History » Version 13

Haitao Zhang, 02/14/2018 01:43 PM

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