2020-09-17 23:02:40 +03:00
|
|
|
// Copyright (c) Vitaliy Filippov, 2019+
|
2021-02-06 01:26:07 +03:00
|
|
|
// License: VNPL-1.1 or GNU GPL-2.0+ (see README.md for details)
|
2020-09-17 23:02:40 +03:00
|
|
|
|
2020-05-21 21:00:54 +03:00
|
|
|
#include "pg_states.h"
|
|
|
|
|
2023-04-10 01:05:41 +03:00
|
|
|
const int pg_state_bit_count = 17;
|
2020-05-21 21:00:54 +03:00
|
|
|
|
2023-04-10 01:05:41 +03:00
|
|
|
const int pg_state_bits[17] = {
|
2020-05-21 21:00:54 +03:00
|
|
|
PG_STARTING,
|
|
|
|
PG_PEERING,
|
|
|
|
PG_INCOMPLETE,
|
|
|
|
PG_ACTIVE,
|
2021-04-07 01:29:30 +03:00
|
|
|
PG_REPEERING,
|
2020-05-21 21:00:54 +03:00
|
|
|
PG_STOPPING,
|
|
|
|
PG_OFFLINE,
|
|
|
|
PG_DEGRADED,
|
2023-04-10 01:05:41 +03:00
|
|
|
PG_HAS_INCONSISTENT,
|
2023-01-21 01:35:31 +03:00
|
|
|
PG_HAS_CORRUPTED,
|
2020-05-21 21:00:54 +03:00
|
|
|
PG_HAS_INCOMPLETE,
|
|
|
|
PG_HAS_DEGRADED,
|
|
|
|
PG_HAS_MISPLACED,
|
|
|
|
PG_HAS_UNCLEAN,
|
2020-09-04 22:17:44 +03:00
|
|
|
PG_HAS_INVALID,
|
2020-05-21 21:00:54 +03:00
|
|
|
PG_LEFT_ON_DEAD,
|
2023-02-21 00:21:23 +03:00
|
|
|
PG_SCRUBBING,
|
2020-05-21 21:00:54 +03:00
|
|
|
};
|
|
|
|
|
2023-04-10 01:05:41 +03:00
|
|
|
const char *pg_state_names[17] = {
|
2020-05-21 21:00:54 +03:00
|
|
|
"starting",
|
|
|
|
"peering",
|
|
|
|
"incomplete",
|
|
|
|
"active",
|
2021-04-07 01:29:30 +03:00
|
|
|
"repeering",
|
2020-05-21 21:00:54 +03:00
|
|
|
"stopping",
|
|
|
|
"offline",
|
|
|
|
"degraded",
|
2023-04-10 01:05:41 +03:00
|
|
|
"has_inconsistent",
|
2023-01-21 01:35:31 +03:00
|
|
|
"has_corrupted",
|
2020-05-21 21:00:54 +03:00
|
|
|
"has_incomplete",
|
|
|
|
"has_degraded",
|
|
|
|
"has_misplaced",
|
|
|
|
"has_unclean",
|
2020-09-04 22:17:44 +03:00
|
|
|
"has_invalid",
|
2020-05-21 21:00:54 +03:00
|
|
|
"left_on_dead",
|
2023-02-21 00:21:23 +03:00
|
|
|
"scrubbing",
|
2020-05-21 21:00:54 +03:00
|
|
|
};
|
2023-04-10 01:05:41 +03:00
|
|
|
|
|
|
|
const int object_state_bit_count = 8;
|
|
|
|
|
|
|
|
const int object_state_bits[8] = {
|
|
|
|
OBJ_DEGRADED,
|
|
|
|
OBJ_INCOMPLETE,
|
|
|
|
OBJ_MISPLACED,
|
|
|
|
OBJ_CORRUPTED,
|
|
|
|
OBJ_INCONSISTENT,
|
|
|
|
OBJ_NEEDS_STABLE,
|
|
|
|
OBJ_NEEDS_ROLLBACK,
|
|
|
|
0,
|
|
|
|
};
|
|
|
|
|
|
|
|
const char *object_state_names[8] = {
|
|
|
|
"degraded",
|
|
|
|
"incomplete",
|
|
|
|
"misplaced",
|
|
|
|
"corrupted",
|
|
|
|
"inconsistent",
|
|
|
|
"needs_stable",
|
|
|
|
"needs_rollback",
|
|
|
|
"clean",
|
|
|
|
};
|