forked from vitalif/vitastor
Make MON filter OSDs by block layout to prevent "refusing to start PGs of this pool" errors on misconfiguration
parent
27d0d5b06a
commit
ff479a102d
|
@ -205,9 +205,8 @@ This parameter usually doesn't require to be changed.
|
||||||
- Default: 131072
|
- Default: 131072
|
||||||
|
|
||||||
Block size for this pool. The value from /vitastor/config/global is used when
|
Block size for this pool. The value from /vitastor/config/global is used when
|
||||||
unspecified. If your cluster has OSDs with different block sizes then pool must
|
unspecified. Only OSDs with matching block_size are used for each pool. If you
|
||||||
be restricted by [osd_tags](#osd_tags) to only include OSDs with matching block
|
want to further restrict OSDs for the pool, use [osd_tags](#osd_tags).
|
||||||
size.
|
|
||||||
|
|
||||||
Read more about this parameter in [Cluster-Wide Disk Layout Parameters](layout-cluster.en.md#block_size).
|
Read more about this parameter in [Cluster-Wide Disk Layout Parameters](layout-cluster.en.md#block_size).
|
||||||
|
|
||||||
|
@ -216,10 +215,9 @@ Read more about this parameter in [Cluster-Wide Disk Layout Parameters](layout-c
|
||||||
- Type: integer
|
- Type: integer
|
||||||
- Default: 4096
|
- Default: 4096
|
||||||
|
|
||||||
"Sector" size of virtual disks in this pool. The value from
|
"Sector" size of virtual disks in this pool. The value from /vitastor/config/global
|
||||||
/vitastor/config/global is used when unspecified. Similar to block_size, the
|
is used when unspecified. Similarly to block_size, only OSDs with matching
|
||||||
pool must be restricted by [osd_tags](#osd_tags) to only include OSDs with
|
bitmap_granularity are used for each pool.
|
||||||
matching bitmap_granularity.
|
|
||||||
|
|
||||||
Read more about this parameter in [Cluster-Wide Disk Layout Parameters](layout-cluster.en.md#bitmap_granularity).
|
Read more about this parameter in [Cluster-Wide Disk Layout Parameters](layout-cluster.en.md#bitmap_granularity).
|
||||||
|
|
||||||
|
@ -229,10 +227,11 @@ Read more about this parameter in [Cluster-Wide Disk Layout Parameters](layout-c
|
||||||
- Default: none
|
- Default: none
|
||||||
|
|
||||||
Immediate commit setting for this pool. The value from /vitastor/config/global
|
Immediate commit setting for this pool. The value from /vitastor/config/global
|
||||||
is used when unspecified. Similar to block_size, the pool must be restricted by
|
is used when unspecified. Similarly to block_size, only OSDs with compatible
|
||||||
[osd_tags](#osd_tags) to only include OSDs with compatible immediate_commit.
|
bitmap_granularity are used for each pool. "Compatible" means that a pool with
|
||||||
Compatible means that a pool with non-immediate commit will work with OSDs with
|
non-immediate commit will use OSDs with immediate commit enabled, but not vice
|
||||||
immediate commit enabled, but not vice versa.
|
versa. I.e., pools with "none" use all OSDs, pools with "small" only use OSDs
|
||||||
|
with "all" or "small", and pools with "all" only use OSDs with "all".
|
||||||
|
|
||||||
Read more about this parameter in [Cluster-Wide Disk Layout Parameters](layout-cluster.en.md#immediate_commit).
|
Read more about this parameter in [Cluster-Wide Disk Layout Parameters](layout-cluster.en.md#immediate_commit).
|
||||||
|
|
||||||
|
|
|
@ -208,8 +208,9 @@ PG в Vitastor эферемерны, то есть вы можете менят
|
||||||
|
|
||||||
Размер блока для данного пула. Если не задан, используется значение из
|
Размер блока для данного пула. Если не задан, используется значение из
|
||||||
/vitastor/config/global. Если в вашем кластере есть OSD с разными размерами
|
/vitastor/config/global. Если в вашем кластере есть OSD с разными размерами
|
||||||
блока, пул должен быть ограничен только OSD, блок которых равен блоку пула,
|
блока, пул будет использовать только OSD с размером блока, равным размеру блока
|
||||||
с помощью [osd_tags](#osd_tags).
|
пула. Если вы хотите сильнее ограничить набор используемых для пула OSD -
|
||||||
|
используйте [osd_tags](#osd_tags).
|
||||||
|
|
||||||
О самом параметре читайте в разделе [Дисковые параметры уровня кластера](layout-cluster.ru.md#block_size).
|
О самом параметре читайте в разделе [Дисковые параметры уровня кластера](layout-cluster.ru.md#block_size).
|
||||||
|
|
||||||
|
@ -219,9 +220,8 @@ PG в Vitastor эферемерны, то есть вы можете менят
|
||||||
- По умолчанию: 4096
|
- По умолчанию: 4096
|
||||||
|
|
||||||
Размер "сектора" виртуальных дисков в данном пуле. Если не задан, используется
|
Размер "сектора" виртуальных дисков в данном пуле. Если не задан, используется
|
||||||
значение из /vitastor/config/global. Аналогично block_size, пул должен быть
|
значение из /vitastor/config/global. Аналогично block_size, каждый пул будет
|
||||||
ограничен OSD со значением bitmap_granularity, равным значению пула, с помощью
|
использовать только OSD с совпадающей с пулом настройкой bitmap_granularity.
|
||||||
[osd_tags](#osd_tags).
|
|
||||||
|
|
||||||
О самом параметре читайте в разделе [Дисковые параметры уровня кластера](layout-cluster.ru.md#bitmap_granularity).
|
О самом параметре читайте в разделе [Дисковые параметры уровня кластера](layout-cluster.ru.md#bitmap_granularity).
|
||||||
|
|
||||||
|
@ -231,11 +231,13 @@ PG в Vitastor эферемерны, то есть вы можете менят
|
||||||
- По умолчанию: none
|
- По умолчанию: none
|
||||||
|
|
||||||
Настройка мгновенного коммита для данного пула. Если не задана, используется
|
Настройка мгновенного коммита для данного пула. Если не задана, используется
|
||||||
значение из /vitastor/config/global. Аналогично block_size, пул должен быть
|
значение из /vitastor/config/global. Аналогично block_size, каждый пул будет
|
||||||
ограничен OSD со значением bitmap_granularity, совместимым со значением пула, с
|
использовать только OSD с *совместимыми* настройками immediate_commit.
|
||||||
помощью [osd_tags](#osd_tags). Совместимость означает, что пул с отключенным
|
"Совместимыми" означает, что пул с отключенным мгновенным коммитом будет
|
||||||
мгновенным коммитом может работать на OSD с включённым мгновенным коммитом, но
|
использовать OSD с включённым мгновенным коммитом, но не наоборот. То есть,
|
||||||
не наоборот.
|
пул со значением "none" будет использовать все OSD, пул со "small" будет
|
||||||
|
использовать OSD с "all" или "small", а пул с "all" будет использовать только
|
||||||
|
OSD с "all".
|
||||||
|
|
||||||
О самом параметре читайте в разделе [Дисковые параметры уровня кластера](layout-cluster.ru.md#immediate_commit).
|
О самом параметре читайте в разделе [Дисковые параметры уровня кластера](layout-cluster.ru.md#immediate_commit).
|
||||||
|
|
||||||
|
|
33
mon/mon.js
33
mon/mon.js
|
@ -1156,6 +1156,33 @@ class Mon
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
filter_osds_by_block_layout(flat_tree, block_size, bitmap_granularity, immediate_commit)
|
||||||
|
{
|
||||||
|
for (const host in flat_tree)
|
||||||
|
{
|
||||||
|
let found = 0;
|
||||||
|
for (const osd in flat_tree[host])
|
||||||
|
{
|
||||||
|
const osd_stat = this.state.osd.stats[osd];
|
||||||
|
if (osd_stat && (osd_stat.bs_block_size && osd_stat.bs_block_size != block_size ||
|
||||||
|
osd_stat.bitmap_granularity && osd_stat.bitmap_granularity != bitmap_granularity ||
|
||||||
|
osd_stat.immediate_commit == 'small' && immediate_commit == 'all' ||
|
||||||
|
osd_stat.immediate_commit == 'none' && immediate_commit != 'none'))
|
||||||
|
{
|
||||||
|
delete flat_tree[host][osd];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
found++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
delete flat_tree[host];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
get_affinity_osds(pool_cfg, up_osds, osd_tree)
|
get_affinity_osds(pool_cfg, up_osds, osd_tree)
|
||||||
{
|
{
|
||||||
let aff_osds = up_osds;
|
let aff_osds = up_osds;
|
||||||
|
@ -1216,6 +1243,12 @@ class Mon
|
||||||
pool_tree = pool_tree ? pool_tree.children : [];
|
pool_tree = pool_tree ? pool_tree.children : [];
|
||||||
pool_tree = LPOptimizer.flatten_tree(pool_tree, levels, pool_cfg.failure_domain, 'osd');
|
pool_tree = LPOptimizer.flatten_tree(pool_tree, levels, pool_cfg.failure_domain, 'osd');
|
||||||
this.filter_osds_by_tags(osd_tree, pool_tree, pool_cfg.osd_tags);
|
this.filter_osds_by_tags(osd_tree, pool_tree, pool_cfg.osd_tags);
|
||||||
|
this.filter_osds_by_block_layout(
|
||||||
|
pool_tree,
|
||||||
|
pool_cfg.block_size || this.config.block_size || 131072,
|
||||||
|
pool_cfg.bitmap_granularity || this.config.bitmap_granularity || 4096,
|
||||||
|
pool_cfg.immediate_commit || this.config.immediate_commit || 'none'
|
||||||
|
);
|
||||||
// These are for the purpose of building history.osd_sets
|
// These are for the purpose of building history.osd_sets
|
||||||
const real_prev_pgs = [];
|
const real_prev_pgs = [];
|
||||||
let pg_history = [];
|
let pg_history = [];
|
||||||
|
|
|
@ -186,10 +186,12 @@ json11::Json osd_t::get_statistics()
|
||||||
if (bs)
|
if (bs)
|
||||||
{
|
{
|
||||||
st["blockstore_ready"] = bs->is_started();
|
st["blockstore_ready"] = bs->is_started();
|
||||||
st["data_block_size"] = (uint64_t)bs->get_block_size();
|
|
||||||
st["size"] = bs->get_block_count() * bs->get_block_size();
|
st["size"] = bs->get_block_count() * bs->get_block_size();
|
||||||
st["free"] = bs->get_free_block_count() * bs->get_block_size();
|
st["free"] = bs->get_free_block_count() * bs->get_block_size();
|
||||||
}
|
}
|
||||||
|
st["data_block_size"] = (uint64_t)bs_block_size;
|
||||||
|
st["bitmap_granularity"] = (uint64_t)bs_bitmap_granularity;
|
||||||
|
st["immediate_commit"] = immediate_commit == IMMEDIATE_ALL ? "all" : (immediate_commit == IMMEDIATE_SMALL ? "small" : "none");
|
||||||
st["host"] = self_state["host"];
|
st["host"] = self_state["host"];
|
||||||
json11::Json::object op_stats, subop_stats;
|
json11::Json::object op_stats, subop_stats;
|
||||||
for (int i = OSD_OP_MIN; i <= OSD_OP_MAX; i++)
|
for (int i = OSD_OP_MIN; i <= OSD_OP_MAX; i++)
|
||||||
|
|
Loading…
Reference in New Issue