From 085c145a182c0030351e59ce6aed0cd292c00758 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Tue, 1 Sep 2020 16:29:42 +0300 Subject: [PATCH] Document etcd data (to-be state with pools) at least in some form --- lp/mon.js | 109 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 100 insertions(+), 9 deletions(-) diff --git a/lp/mon.js b/lp/mon.js index 4a83477ff..63fe02421 100644 --- a/lp/mon.js +++ b/lp/mon.js @@ -8,11 +8,11 @@ const PGUtil = require('./PGUtil.js'); // FIXME Split into several files class Mon { - // FIXME document all etcd keys and config variables + // FIXME document all etcd keys and config variables in the form of JSON schema or similar static etcd_tree = { config: { /* global: { - etcd_report_interval: 30, // osd, min: 10 + // mon etcd_mon_ttl: 30, // min: 10 etcd_mon_timeout: 1000, // min: 0 etcd_mon_retries: 5, // min: 0 @@ -21,6 +21,27 @@ class Mon osd_out_time: 1800, // min: 0 max_osd_combinations: 10000, // min: 100 placement_levels: { datacenter: 1, rack: 2, host: 3, osd: 4, ... }, + // client and osd + use_sync_send_recv: false, + log_level: 0, + block_size: 131072, + disk_alignment: 4096, + bitmap_granularity: 4096, + pg_stripe_size: 4194304, + immediate_commit: false, // 'all' or 'small' + client_dirty_limit: 33554432, + peer_connect_interval: 5, + peer_connect_timeout: 5, + // osd + etcd_report_interval: 30, // min: 10 + run_primary: true, + bind_address: "0.0.0.0", + bind_port: 0, + autosync_interval: 5, + client_queue_depth: 128, // unused + recovery_queue_depth: 4, + readonly: false, + print_stats_interval: 3, }, */ global: null, /* node_placement: { @@ -28,23 +49,93 @@ class Mon ... }, */ node_placement: null, + /* pools: { + : { + id: 1, + pg_count: 100, + failure_domain: 'host', + }, + ... + }, */ + pools: null, osd: { /* : { reweight: 1 }, ... */ }, - pgs: {}, + /* pgs: { + : { + : { + osd_set: [ 1, 2, 3 ], + primary: 1, + pause: false, + } + } + }, */ + pgs: null, }, osd: { - state: {}, - stats: {}, + state: { + /* : { + state: "up", + addresses: string[], + host: string, + port: uint16_t, + primary_enabled: boolean, + blockstore_enabled: boolean, + }, */ + }, + stats: { + /* : { + time: number, // unix time + blockstore_ready: boolean, + size: uint64_t, // bytes + free: uint64_t, // bytes + host: string, + op_stats: { + : { count: uint64_t, usec: uint64_t, bytes: uint64_t }, + }, + subop_stats: { + : { count: uint64_t, usec: uint64_t }, + }, + recovery_stats: { + degraded: { count: uint64_t, bytes: uint64_t }, + misplaced: { count: uint64_t, bytes: uint64_t }, + }, + }, */ + }, }, mon: { master: null, }, pg: { - change_stamp: null, - state: {}, - stats: {}, - history: {}, + state: { + /* : { + : { + primary: osd_num_t, + state: ("starting"|"peering"|"incomplete"|"active"|"stopping"|"offline"|"degraded"|"has_incomplete"|"has_degraded"|"has_misplaced"|"has_unclean"|"left_on_dead")[], + } + }, */ + }, + stats: { + /* : { + : { + object_count: int, + clean_count: int, + misplaced_count: int, + degraded_count: int, + incomplete_count: int, + write_osd_set: osd_num_t[], + }, + }, */ + }, + history: { + /* : { + : { + osd_sets: osd_num_t[][], + all_peers: osd_num_t[], + epoch: int, + }, + }, */ + }, }, }