Skip to content

Commit

Permalink
DAOS-9583 proto: DAOS check protocol changes (#8941)
Browse files Browse the repository at this point in the history
Contain the following changes:

1. Replace 'bool repaired' as 'int32 result' for check report.
2. Remove uselss 'CIS_CRASHED' status for check instance.
3. Split 'CPS_STOPPED' from 'CPS_PAUSED' for pool status.
4. New instance status: CIS_IMPLICATED, for the case that the
   check on the engine exit because of other engine failure.
5. New pool status: CPS_IMPLICATED, for the case that the check
   on the pool is stopped because of other pool or engine failure.

Related changes for control plane part with go will be in another patch.

Signed-off-by: Fan Yong <[email protected]>
  • Loading branch information
Nasf-Fan authored May 16, 2022
1 parent 8f87a11 commit 15f29e5
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 23 deletions.
26 changes: 15 additions & 11 deletions src/chk/chk.pb-c.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ static const ProtobufCFieldDescriptor chk__check_report__field_descriptors[16] =
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"repaired",
"result",
4,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BOOL,
PROTOBUF_C_TYPE_INT32,
0, /* quantifier_offset */
offsetof(Chk__CheckReport, repaired),
offsetof(Chk__CheckReport, result),
NULL,
NULL,
0, /* flags */
Expand Down Expand Up @@ -260,7 +260,7 @@ static const unsigned chk__check_report__field_indices_by_name[] = {
8, /* field[8] = objid */
6, /* field[6] = pool_uuid */
4, /* field[4] = rank */
3, /* field[3] = repaired */
3, /* field[3] = result */
0, /* field[0] = seq */
5, /* field[5] = target */
11, /* field[11] = timestamp */
Expand Down Expand Up @@ -445,16 +445,16 @@ static const ProtobufCEnumValue chk__check_inst_status__enum_values_by_number[7]
{ "CIS_STOPPED", "CHK__CHECK_INST_STATUS__CIS_STOPPED", 3 },
{ "CIS_FAILED", "CHK__CHECK_INST_STATUS__CIS_FAILED", 4 },
{ "CIS_PAUSED", "CHK__CHECK_INST_STATUS__CIS_PAUSED", 5 },
{ "CIS_CRASHED", "CHK__CHECK_INST_STATUS__CIS_CRASHED", 6 },
{ "CIS_IMPLICATED", "CHK__CHECK_INST_STATUS__CIS_IMPLICATED", 6 },
};
static const ProtobufCIntRange chk__check_inst_status__value_ranges[] = {
{0, 0},{0, 7}
};
static const ProtobufCEnumValueIndex chk__check_inst_status__enum_values_by_name[7] =
{
{ "CIS_COMPLETED", 2 },
{ "CIS_CRASHED", 6 },
{ "CIS_FAILED", 4 },
{ "CIS_IMPLICATED", 6 },
{ "CIS_INIT", 0 },
{ "CIS_PAUSED", 5 },
{ "CIS_RUNNING", 1 },
Expand All @@ -475,25 +475,29 @@ const ProtobufCEnumDescriptor chk__check_inst_status__descriptor =
chk__check_inst_status__value_ranges,
NULL,NULL,NULL,NULL /* reserved[1234] */
};
static const ProtobufCEnumValue chk__check_pool_status__enum_values_by_number[6] =
static const ProtobufCEnumValue chk__check_pool_status__enum_values_by_number[8] =
{
{ "CPS_UNCHECKED", "CHK__CHECK_POOL_STATUS__CPS_UNCHECKED", 0 },
{ "CPS_CHECKING", "CHK__CHECK_POOL_STATUS__CPS_CHECKING", 1 },
{ "CPS_CHECKED", "CHK__CHECK_POOL_STATUS__CPS_CHECKED", 2 },
{ "CPS_FAILED", "CHK__CHECK_POOL_STATUS__CPS_FAILED", 3 },
{ "CPS_PAUSED", "CHK__CHECK_POOL_STATUS__CPS_PAUSED", 4 },
{ "CPS_PENDING", "CHK__CHECK_POOL_STATUS__CPS_PENDING", 5 },
{ "CPS_STOPPED", "CHK__CHECK_POOL_STATUS__CPS_STOPPED", 6 },
{ "CPS_IMPLICATED", "CHK__CHECK_POOL_STATUS__CPS_IMPLICATED", 7 },
};
static const ProtobufCIntRange chk__check_pool_status__value_ranges[] = {
{0, 0},{0, 6}
{0, 0},{0, 8}
};
static const ProtobufCEnumValueIndex chk__check_pool_status__enum_values_by_name[6] =
static const ProtobufCEnumValueIndex chk__check_pool_status__enum_values_by_name[8] =
{
{ "CPS_CHECKED", 2 },
{ "CPS_CHECKING", 1 },
{ "CPS_FAILED", 3 },
{ "CPS_IMPLICATED", 7 },
{ "CPS_PAUSED", 4 },
{ "CPS_PENDING", 5 },
{ "CPS_STOPPED", 6 },
{ "CPS_UNCHECKED", 0 },
};
const ProtobufCEnumDescriptor chk__check_pool_status__descriptor =
Expand All @@ -503,9 +507,9 @@ const ProtobufCEnumDescriptor chk__check_pool_status__descriptor =
"CheckPoolStatus",
"Chk__CheckPoolStatus",
"chk",
6,
8,
chk__check_pool_status__enum_values_by_number,
6,
8,
chk__check_pool_status__enum_values_by_name,
1,
chk__check_pool_status__value_ranges,
Expand Down
29 changes: 20 additions & 9 deletions src/chk/chk.pb-c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions src/proto/chk/chk.proto
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ enum CheckInstStatus {
CIS_STOPPED = 3; // DAOS check has been explicitly stopped, do not allow to rejoin.
CIS_FAILED = 4; // DAOS check auto stopped for some unrecoverable failure, do not rejoin.
CIS_PAUSED = 5; // DAOS check has been paused because engine exit, allow to rejoin.
CIS_CRASHED = 6; // Engine crashed during DAOS check scan, allow to rejoin.
CIS_IMPLICATED = 6; // Check on the engine exit for other engine failure, do not rejoin.
}

// The pool status for DAOS check.
Expand All @@ -155,8 +155,10 @@ enum CheckPoolStatus {
CPS_CHECKING = 1; // The pool is being checked.
CPS_CHECKED = 2; // DAOS check has successfully completed all the passes on this pool.
CPS_FAILED = 3; // DAOS check could not be completed due to some unrecoverable failure.
CPS_PAUSED = 4; // Checking the pool has been put on hold or stopped.
CPS_PAUSED = 4; // Checking the pool has been paused because engine exit.
CPS_PENDING = 5; // Waiting for the decision from the admin.
CPS_STOPPED = 6; // DAOS check on the pool has been stopped explicitly.
CPS_IMPLICATED = 7; // Check on the pool is stopped because of other pool or engine failure.
}

// DAOS check engine scan phases.
Expand Down Expand Up @@ -193,7 +195,11 @@ message CheckReport {
uint64 seq = 1; // DAOS Check event sequence, unique for the instance.
CheckInconsistClass class = 2; // Inconsistency class
CheckInconsistAction action = 3; // The action taken to repair the inconsistency
bool repaired = 4; // Repaired or not, meaningless if the action is CIA_INTERACT.
// Repair result: zero is for repaired successfully.
// negative value if failed to repair.
// positive value is for CIA_IGNORE or dryrun mode.
// It is meaningless if the action is CIA_INTERACT.
int32 result = 4;
uint32 rank = 5; // Inconsistency happened on which rank if applicable.
uint32 target = 6; // Inconsistency happened on which target in the rank if applicable.
string pool_uuid = 7; // The consistency is in which pool if applicable.
Expand Down

0 comments on commit 15f29e5

Please sign in to comment.