Skip to content

Commit 73bc1b0

Browse files
committed
status: add "incomplete success" code
The name was chosen specifically to avoid linking it to HTTP "206 Partial Content" which has a different semantics. This can help with * nspcc-dev/neofs-node#2721 * nspcc-dev/neofs-node#3428 Signed-off-by: Roman Khimov <roman@nspcc.ru>
1 parent 03932ff commit 73bc1b0

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

object/service.proto

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ service ObjectService {
6464
// Statuses:
6565
// - **OK** (0, SECTION_SUCCESS): \
6666
// object has been successfully saved in the container;
67+
// - **INCOMPLETE** (1, SECTION_SUCCESS): \
68+
// object was put to some nodes, but the number of replicas is not sufficient
69+
// to satisfy placement policy;
6770
// - Common failures (SECTION_FAILURE_COMMON);
6871
// - **ACCESS_DENIED** (2048, SECTION_OBJECT): \
6972
// write access to the container is denied;
@@ -99,6 +102,9 @@ service ObjectService {
99102
// Statuses:
100103
// - **OK** (0, SECTION_SUCCESS): \
101104
// object has been successfully marked to be removed from the container;
105+
// - **INCOMPLETE** (1, SECTION_SUCCESS): \
106+
// some nodes have accepted the deletion mark, but some may still store
107+
// the object;
102108
// - Common failures (SECTION_FAILURE_COMMON);
103109
// - **ACCESS_DENIED** (2048, SECTION_OBJECT): \
104110
// delete access to the object is denied;
@@ -153,6 +159,9 @@ service ObjectService {
153159
// Statuses:
154160
// - **OK** (0, SECTION_SUCCESS): \
155161
// objects have been successfully selected;
162+
// - **INCOMPLETE** (1, SECTION_SUCCESS): \
163+
// some nodes were unable to process the request, so the result may
164+
// not contain all data;
156165
// - Common failures (SECTION_FAILURE_COMMON);
157166
// - **ACCESS_DENIED** (2048, SECTION_OBJECT): \
158167
// access to operation SEARCH of the object is denied;

proto-docs/status.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ Section of NeoFS successful return codes.
158158
| Name | Number | Description |
159159
| ---- | ------ | ----------- |
160160
| OK | 0 | [**0**] Default success. Not detailed. If the server cannot match successful outcome to the code, it should use this code. |
161+
| INCOMPLETE | 1 | [**1**] Incomplete success, only a part of the request done which may or may not be sufficient for the client. Examples are object PUT making 2 out of 3 required replicas or distributed SEARCH getting result from 4 out of 5 nodes. |
161162

162163

163164
<!-- end enums -->

status/types.proto

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ enum Success {
8181
// If the server cannot match successful outcome to the code, it should
8282
// use this code.
8383
OK = 0;
84+
85+
// [**1**] Incomplete success, only a part of the request done which may
86+
// or may not be sufficient for the client. Examples are object PUT making
87+
// 2 out of 3 required replicas or distributed SEARCH getting result from
88+
// 4 out of 5 nodes.
89+
INCOMPLETE = 1;
8490
}
8591

8692
// Section of failed statuses independent of the operation.

0 commit comments

Comments
 (0)