Skip to content

Commit ed98f08

Browse files
authored
Merge pull request #346 from nspcc-dev/new-status-codes
2 parents 774e6bb + aca7dcc commit ed98f08

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ Section of failed statuses independent of the operation.
9090
| WRONG_MAGIC_NUMBER | 1 | [**1025**] Wrong magic of the NeoFS network. Details: - [**0**] Magic number of the served NeoFS network (big-endian 64-bit unsigned integer). |
9191
| SIGNATURE_VERIFICATION_FAIL | 2 | [**1026**] Signature verification failure. |
9292
| NODE_UNDER_MAINTENANCE | 3 | [**1027**] Node is under maintenance. |
93+
| BAD_REQUEST | 4 | [**1028**] Malformed, syntactically or semantically incorrect request, client-side error. |
94+
| BUSY | 5 | [**1029**] Some node resources are exhausted and request can't be processed. This is likely to be a transient state and request can be retried in future. |
9395

9496

9597

@@ -157,6 +159,7 @@ Section of NeoFS successful return codes.
157159
| Name | Number | Description |
158160
| ---- | ------ | ----------- |
159161
| OK | 0 | [**0**] Default success. Not detailed. If the server cannot match successful outcome to the code, it should use this code. |
162+
| 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. |
160163

161164

162165
<!-- end enums -->

status/types.proto

Lines changed: 15 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.
@@ -101,6 +107,15 @@ enum CommonFail {
101107

102108
// [**1027**] Node is under maintenance.
103109
NODE_UNDER_MAINTENANCE = 3;
110+
111+
// [**1028**] Malformed, syntactically or semantically incorrect request,
112+
// client-side error.
113+
BAD_REQUEST = 4;
114+
115+
// [**1029**] Some node resources are exhausted and request can't be
116+
// processed. This is likely to be a transient state and request can be
117+
// retried in future.
118+
BUSY = 5;
104119
}
105120

106121
// Section of statuses for object-related operations.

0 commit comments

Comments
 (0)