feat(controller): wire real limits.yaml config through cluster_config
xcesched_push_configs() sent two hardcoded limit1/limits2 test literals to the scheduler (behind a #if 0/FIXME "we use builtin limit currently"), ignoring whatever was actually loaded from cluster_config. Migrate those literals into limits.yaml as real entries and wire conf4sched->nlimits/limits from c->myconf->cluster_config directly. cluster_init_phase2 also downgrades its "cluster_config not loaded" ERROR to INFO — a standby legitimately reaching phase2 before the primary's config-push has delivered bytes yet is normal cold-boot behavior, not a failure; it already matches load_primary_config's INFO-level framing for the same condition.
This commit is contained in:
parent
0649e17f62
commit
18e7a0e9e1
3 changed files with 45 additions and 49 deletions
|
|
@ -47,3 +47,33 @@ limits:
|
||||||
- normal
|
- normal
|
||||||
resname: slots
|
resname: slots
|
||||||
value: 8
|
value: 8
|
||||||
|
|
||||||
|
# migrated from src/controller/sched.c xcesched_push_configs()'s
|
||||||
|
# hardcoded limit1_config literal (all users except rshen, shared
|
||||||
|
# 3-slot cap)
|
||||||
|
- name: limit1
|
||||||
|
users:
|
||||||
|
members:
|
||||||
|
- all
|
||||||
|
exclude_members:
|
||||||
|
- rshen
|
||||||
|
resname: slots
|
||||||
|
value: 3.0
|
||||||
|
|
||||||
|
# migrated from src/controller/sched.c xcesched_push_configs()'s
|
||||||
|
# hardcoded limit2_config literal (rshen on the xce queue, per-user/
|
||||||
|
# per-queue/per-project/per-host 20% mem cap)
|
||||||
|
- name: limits2
|
||||||
|
per_user: true
|
||||||
|
per_queue: true
|
||||||
|
per_project: true
|
||||||
|
per_host: true
|
||||||
|
users:
|
||||||
|
members:
|
||||||
|
- rshen
|
||||||
|
queues:
|
||||||
|
members:
|
||||||
|
- xce
|
||||||
|
resname: mem
|
||||||
|
value: 0.2
|
||||||
|
percent: true
|
||||||
|
|
|
||||||
|
|
@ -1303,7 +1303,14 @@ int cluster_init_phase2(cluster_t* c)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (c->myconf->cluster_config == NULL) {
|
if (c->myconf->cluster_config == NULL) {
|
||||||
ERROR("cluster_init_phase2: cluster_config not loaded");
|
/* Normal during cold boot: a standby reaches phase2 (post-election)
|
||||||
|
* before the primary's config-push has delivered bytes yet. Not a
|
||||||
|
* divergence or a hard failure — matches load_primary_config's own
|
||||||
|
* "will fetch from primary after election" INFO-level framing for
|
||||||
|
* the same underlying condition. The caller retries. */
|
||||||
|
INFO("cluster_init_phase2: cluster_config not loaded yet — normal "
|
||||||
|
"during cold boot while awaiting the primary's config-push; "
|
||||||
|
"will retry once it arrives");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -138,47 +138,11 @@ static int xcesched_push_workerlist(cluster_t* c, xlist_t* l)
|
||||||
static int xcesched_push_configs(cluster_t* c)
|
static int xcesched_push_configs(cluster_t* c)
|
||||||
{
|
{
|
||||||
xce_configdata_t configdata;
|
xce_configdata_t configdata;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
xce_limit_config_t limit1_config = {
|
xlist_t clist;
|
||||||
.name = "limit1",
|
xlist_t qlist;
|
||||||
.per_user = 0,
|
xlist_t rlist;
|
||||||
.per_queue = 0,
|
xlist_t xreslist;
|
||||||
.per_project = 0,
|
|
||||||
.per_host = 0,
|
|
||||||
.users
|
|
||||||
= &(xce_group_config_t) { .members
|
|
||||||
= { .count = 1, .data = (char*[]) { "all" } },
|
|
||||||
.ex_members
|
|
||||||
= { .count = 1,
|
|
||||||
.data = (char*[]) { "rshen" } } },
|
|
||||||
.queues = NULL,
|
|
||||||
.projects = NULL,
|
|
||||||
.hosts = NULL,
|
|
||||||
.val
|
|
||||||
= &(xce_limit_val_t) { .resname = "slots", .percent = 0, .val = 3.0 }
|
|
||||||
};
|
|
||||||
xce_limit_config_t limit2_config = {
|
|
||||||
.name = "limits2",
|
|
||||||
.per_user = 1,
|
|
||||||
.per_queue = 1,
|
|
||||||
.per_project = 1,
|
|
||||||
.per_host = 1,
|
|
||||||
.users = &(xce_group_config_t) { .members
|
|
||||||
= { .count = 1,
|
|
||||||
.data = (char*[]) { "rshen" } } },
|
|
||||||
.queues
|
|
||||||
= &(xce_group_config_t) { .members = { .count = 1,
|
|
||||||
.data = (char*[]) { "xce" } } },
|
|
||||||
.projects = NULL,
|
|
||||||
.hosts = NULL,
|
|
||||||
.val = &(xce_limit_val_t) { .resname = "mem", .percent = 1, .val = 0.2 }
|
|
||||||
};
|
|
||||||
xce_limit_config_t* limits[] = { &limit1_config, &limit2_config };
|
|
||||||
int nlimits = 2;
|
|
||||||
xlist_t clist;
|
|
||||||
xlist_t qlist;
|
|
||||||
xlist_t rlist;
|
|
||||||
xlist_t xreslist;
|
|
||||||
|
|
||||||
memset(&configdata, 0x0, sizeof(configdata));
|
memset(&configdata, 0x0, sizeof(configdata));
|
||||||
|
|
||||||
|
|
@ -209,13 +173,8 @@ static int xcesched_push_configs(cluster_t* c)
|
||||||
configdata.data.conf4sched->ugroups = c->myconf->cluster_config->ugroups;
|
configdata.data.conf4sched->ugroups = c->myconf->cluster_config->ugroups;
|
||||||
configdata.data.conf4sched->n_hgroups = c->myconf->cluster_config->nhgroups;
|
configdata.data.conf4sched->n_hgroups = c->myconf->cluster_config->nhgroups;
|
||||||
configdata.data.conf4sched->hgroups = c->myconf->cluster_config->hgroups;
|
configdata.data.conf4sched->hgroups = c->myconf->cluster_config->hgroups;
|
||||||
#if 0 /* FIXME: we use builtin limit currently */
|
configdata.data.conf4sched->nlimits = c->myconf->cluster_config->nlimits;
|
||||||
configdata.data.conf4sched->nlimits = c->myconf->cluster_config->nlimits;
|
configdata.data.conf4sched->limits = c->myconf->cluster_config->limits;
|
||||||
configdata.data.conf4sched->limits = c->myconf->cluster_config->limits;
|
|
||||||
#else
|
|
||||||
configdata.data.conf4sched->nlimits = nlimits;
|
|
||||||
configdata.data.conf4sched->limits = &(limits[0]);
|
|
||||||
#endif
|
|
||||||
configdata.data.conf4sched->nhproviders
|
configdata.data.conf4sched->nhproviders
|
||||||
= c->myconf->cluster_config->nhproviders;
|
= c->myconf->cluster_config->nhproviders;
|
||||||
configdata.data.conf4sched->hproviders
|
configdata.data.conf4sched->hproviders
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue