Skip to content

Commit

Permalink
DAOS-9590 chk: Refactor checker messages
Browse files Browse the repository at this point in the history
  * Move CheckReport to chk package
    - Separate report request from payload
    - Add Actions and Details lists to allow the checker to
      specify defined actions that could be taken in response
      to the inconsistency report.
    - Rename chk/check -> chk/chk to ensure unique namespaces.
  * Adjust srv/mgmt messages to use chk types directly

Signed-off-by: Michael MacDonald <[email protected]>
  • Loading branch information
mjmac committed Apr 14, 2022
1 parent 1f32324 commit a81b51d
Show file tree
Hide file tree
Showing 22 changed files with 1,749 additions and 1,447 deletions.
5 changes: 4 additions & 1 deletion src/chk/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ def scons():
prereqs.require(denv, 'argobots', 'protobufc')

# chk
chk_pb = denv.SharedObject(['chk.pb-c.c'])
chk = daos_build.library(denv, 'chk',
['check.pb-c.c', 'chk_srv.c', 'chk_common.c'],
[chk_pb, 'chk_srv.c', 'chk_common.c'],
install_off="../..")
denv.Install('$PREFIX/lib64/daos_srv', chk)

Export('chk_pb')

if __name__ == "SCons.Script":
scons()
269 changes: 267 additions & 2 deletions src/chk/check.pb-c.c → src/chk/chk.pb-c.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,277 @@
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
/* Generated from: check.proto */
/* Generated from: chk.proto */

/* Do not generate deprecated warnings for self */
#ifndef PROTOBUF_C__NO_DEPRECATED
#define PROTOBUF_C__NO_DEPRECATED
#endif

#include "check.pb-c.h"
#include "chk.pb-c.h"
void chk__check_report__init
(Chk__CheckReport *message)
{
static const Chk__CheckReport init_value = CHK__CHECK_REPORT__INIT;
*message = init_value;
}
size_t chk__check_report__get_packed_size
(const Chk__CheckReport *message)
{
assert(message->base.descriptor == &chk__check_report__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t chk__check_report__pack
(const Chk__CheckReport *message,
uint8_t *out)
{
assert(message->base.descriptor == &chk__check_report__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t chk__check_report__pack_to_buffer
(const Chk__CheckReport *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &chk__check_report__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Chk__CheckReport *
chk__check_report__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Chk__CheckReport *)
protobuf_c_message_unpack (&chk__check_report__descriptor,
allocator, len, data);
}
void chk__check_report__free_unpacked
(Chk__CheckReport *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &chk__check_report__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
static const ProtobufCFieldDescriptor chk__check_report__field_descriptors[15] =
{
{
"seq",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_UINT64,
0, /* quantifier_offset */
offsetof(Chk__CheckReport, seq),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"class",
2,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_ENUM,
0, /* quantifier_offset */
offsetof(Chk__CheckReport, class_),
&chk__check_inconsist_class__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"action",
3,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_ENUM,
0, /* quantifier_offset */
offsetof(Chk__CheckReport, action),
&chk__check_inconsist_action__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"repaired",
4,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BOOL,
0, /* quantifier_offset */
offsetof(Chk__CheckReport, repaired),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"rank",
5,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_UINT32,
0, /* quantifier_offset */
offsetof(Chk__CheckReport, rank),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"target",
6,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_UINT32,
0, /* quantifier_offset */
offsetof(Chk__CheckReport, target),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"pool_uuid",
7,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_STRING,
0, /* quantifier_offset */
offsetof(Chk__CheckReport, pool_uuid),
NULL,
&protobuf_c_empty_string,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"cont_uuid",
8,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_STRING,
0, /* quantifier_offset */
offsetof(Chk__CheckReport, cont_uuid),
NULL,
&protobuf_c_empty_string,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"objid",
9,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_STRING,
0, /* quantifier_offset */
offsetof(Chk__CheckReport, objid),
NULL,
&protobuf_c_empty_string,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"dkey",
10,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_STRING,
0, /* quantifier_offset */
offsetof(Chk__CheckReport, dkey),
NULL,
&protobuf_c_empty_string,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"akey",
11,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_STRING,
0, /* quantifier_offset */
offsetof(Chk__CheckReport, akey),
NULL,
&protobuf_c_empty_string,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"timestamp",
12,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_STRING,
0, /* quantifier_offset */
offsetof(Chk__CheckReport, timestamp),
NULL,
&protobuf_c_empty_string,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"msg",
13,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_STRING,
0, /* quantifier_offset */
offsetof(Chk__CheckReport, msg),
NULL,
&protobuf_c_empty_string,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"actions",
14,
PROTOBUF_C_LABEL_REPEATED,
PROTOBUF_C_TYPE_ENUM,
offsetof(Chk__CheckReport, n_actions),
offsetof(Chk__CheckReport, actions),
&chk__check_inconsist_action__descriptor,
NULL,
0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"details",
15,
PROTOBUF_C_LABEL_REPEATED,
PROTOBUF_C_TYPE_STRING,
offsetof(Chk__CheckReport, n_details),
offsetof(Chk__CheckReport, details),
NULL,
&protobuf_c_empty_string,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned chk__check_report__field_indices_by_name[] = {
2, /* field[2] = action */
13, /* field[13] = actions */
10, /* field[10] = akey */
1, /* field[1] = class */
7, /* field[7] = cont_uuid */
14, /* field[14] = details */
9, /* field[9] = dkey */
12, /* field[12] = msg */
8, /* field[8] = objid */
6, /* field[6] = pool_uuid */
4, /* field[4] = rank */
3, /* field[3] = repaired */
0, /* field[0] = seq */
5, /* field[5] = target */
11, /* field[11] = timestamp */
};
static const ProtobufCIntRange chk__check_report__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 15 }
};
const ProtobufCMessageDescriptor chk__check_report__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"chk.CheckReport",
"CheckReport",
"Chk__CheckReport",
"chk",
sizeof(Chk__CheckReport),
15,
chk__check_report__field_descriptors,
chk__check_report__field_indices_by_name,
1, chk__check_report__number_ranges,
(ProtobufCMessageInit) chk__check_report__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCEnumValue chk__check_inconsist_class__enum_values_by_number[22] =
{
{ "CIC_NONE", "CHK__CHECK_INCONSIST_CLASS__CIC_NONE", 0 },
Expand Down
Loading

0 comments on commit a81b51d

Please sign in to comment.