#define DEF_AGENT_JOBS 8
#define DEF_MIRROR_CMD "lfs mirror extend -N"
#define DEF_FAST_POOL "ddn_ssd"
-#define DEF_TARGET_POOL "ddn_hdd"
+#define DEF_SLOW_POOL "ddn_hdd"
#define DEF_ALR_PERIODS 16
#define DEF_ALR_PERIOD_SECS 10
#define DEF_WARMUP_K 20 /* how fast to warm up / 100 */
#define DEF_STATFS_REFRESH_INTV 5 /* OST statfs update interval, in seconds */
#define DEF_FAST_POOL_FREE 70 /* fast pool is open for migration */
/* if available space is greater, in percent */
-#define DEF_TGT_FREE 10 /* target pool is open for migration */
+#define DEF_SLOW_POOL_FREE 10 /* slow pool is open for migration */
/* if available space is greater, in percent */
#define LAMIGO_USERFILE "/var/lib/lamigo-%s.chlg"
"\t-h, --help, print this help message\n"
"\t-H, --heatfn, # of heat function\n"
"\t-m, --mdt, MDT to monitor for changes and replicate\n"
- "\t--mirror-cmd, how to mirror to target pool (default: '%s')\n"
+ "\t--mirror-cmd, how to mirror to slow pool (default: '%s')\n"
"\t-M, --mount, mountpoint of client used for replication\n"
"\t--progress-interval, seconds between status (default: %u)\n"
"\t-n, --thread-number, threads scanning MDT (default: %u)\n"
DEF_PROGRESS_INTV >> 10,
DEF_THREAD_COUNT,
DEF_FAST_POOL,
- DEF_TARGET_POOL,
+ DEF_SLOW_POOL,
LAMIGO_USERFILE,
LAMIGO_DUMPFILE,
LAMIGO_HEAT_FILE,
DEF_HOT_FRACTION,
DEF_HOT_AFTER_IDLE,
DEF_FAST_POOL_FREE,
- DEF_TGT_FREE);
+ DEF_SLOW_POOL_FREE);
exit(EXIT_SUCCESS);
}
.o_pool_refresh = DEF_POOL_REFRESH_INTV,
.o_statfs_refresh = DEF_STATFS_REFRESH_INTV,
.o_src_free = DEF_FAST_POOL_FREE,
- .o_tgt_free = DEF_TGT_FREE,
+ .o_tgt_free = DEF_SLOW_POOL_FREE,
.o_progress_interval = DEF_PROGRESS_INTV,
.o_alr_extra_args = DEF_ALR_EXTRA_ARGS,
.o_alr_periods = DEF_ALR_PERIODS,
void lamigo_alr_mirror_cb(struct resync_job *rj, void *cbdata, int rc);
struct pool_list *fast_pools; /* fast pools */
-struct pool_list *tgt_pools; /* target pool */
+struct pool_list *slow_pools; /* slow pool */
static void *lamigo_refresh_statfs_thread(void *arg);
static inline bool are_agents_busy(void)
" open: %d\n", pl->pl_pool, pl->pl_ostnr,
pl->pl_avail, pl->pl_total, (int)pl->pl_open);
- for (pl = tgt_pools; pl != NULL; pl = pl->pl_next, i++)
+ for (pl = slow_pools; pl != NULL; pl = pl->pl_next, i++)
fprintf(f, "pool %s:\n"
" osts: %d\n"
" avail: %llu\n"
if (ontgt) {
if (ontgt != objs_in_mirror) {
/* part of this mirror is out of the
- * target pool we can't count it as a
+ * slow pool we can't count it as a
* replica
*/
} else if (stale) {
/* all mirror's object are on the
- * target pool but some component is
+ * slow pool but some component is
* stale
*/
resync = AMIGO_RESYNC_RESYNC;
mo->mo_need_prefer = true;
}
- /* mirror has all objects on the target pool - check for resync
- * mirror has no all objects on the target pool - create new
+ /* mirror has all objects on the slow pool - check for resync
+ * mirror has no all objects on the slow pool - create new
* mirror
*/
k = 0;
/* subject to replication */
if (ontgt) {
if (ontgt != objs_in_mirror) {
- /* part of this mirror is out of the target pool
+ /* part of this mirror is out of the slow pool
* we can't count it as a replica
*/
resync = AMIGO_RESYNC_EXTEND;
stats.s_extend_by_target++;
} else if (stale) {
- /* all mirror's object are on the target pool
+ /* all mirror's object are on the slow pool
* but some component is stale
*/
resync = AMIGO_RESYNC_RESYNC;
int resync, rc;
struct alr_heat ah;
- if (tgt_pools->pl_open == 0) {
+ if (slow_pools->pl_open == 0) {
/* cold pool is close to full, skip replication */
/* do this check before expensive layout fetching, rules, etc */
stats.s_skip_tgt_closed++;
LX_DEBUG("pool %s closed for "DFID"\n",
- tgt_pools->pl_pool, PFID(&f->fr_fh.fh_fid));
+ slow_pools->pl_pool, PFID(&f->fr_fh.fh_fid));
return 0;
}
}
}
- resync = lamigo_is_in_sync(&f->fr_fh.fh_fid, fast_pools, tgt_pools, &mo);
+ resync = lamigo_is_in_sync(&f->fr_fh.fh_fid, fast_pools, slow_pools, &mo);
/* check for a mirror */
if (resync == AMIGO_RESYNC_NONE) {
/* nothing to do */
pl = pl->pl_next;
}
- pl = tgt_pools;
+ pl = slow_pools;
while (pl) {
lamigo_refresh_osts_from_pool(pl);
pl = pl->pl_next;
}
if (opt.o_tgt_pool == NULL) {
- opt.o_tgt_pool = DEF_TARGET_POOL;
- LX_WARN("target pool is not defined, using %s\n", opt.o_tgt_pool);
+ opt.o_tgt_pool = DEF_SLOW_POOL;
+ LX_WARN("slow pool is not defined, using %s\n", opt.o_tgt_pool);
}
opt.o_tgt_pool_len = strlen(opt.o_tgt_pool);
if (lamigo_lookup_fast_pool(opt.o_tgt_pool))
- LX_FATAL("target pool '%s' cannot also be fast pool\n",
+ LX_FATAL("slow pool '%s' cannot also be fast pool\n",
opt.o_tgt_pool);
if (lipe_list_empty(&lamigo_agent_list))
LX_FATAL("no agents configured\n");
- LX_DEBUG("target pool: %s/%d\n", opt.o_tgt_pool,
+ LX_DEBUG("slow pool: %s/%d\n", opt.o_tgt_pool,
opt.o_tgt_pool_len);
- tgt_pools = lamigo_alloc_pool(opt.o_tgt_pool);
+ slow_pools = lamigo_alloc_pool(opt.o_tgt_pool);
if (!opt.o_dump_file) {
snprintf(buf, sizeof(buf), LAMIGO_DUMPFILE, opt.o_mdtname);
rj->rj_fid = *fid;
rj->rj_stripes = mo->mo_stripes;
rj->rj_resync = resync;
- rj->rj_pool = tgt_pools->pl_pool;
+ rj->rj_pool = slow_pools->pl_pool;
rj->rj_callback = lamigo_alr_mirror_cb;
return lamigo_submit_job(rj);
}
resync = lamigo_striping_is_in_sync((void *)attrs->loa_lum, fast_pools,
- tgt_pools, &mo);
+ slow_pools, &mo);
if (resync == AMIGO_RESYNC_NONE) {
lamigo_hist_add(&attrs->loa_fid, resync);
return 0;
/* create and lock pidfile to protect against another instance */
lamigo_lock_pidfile();
- /* wait till the target pool got one OST at least */
- lamigo_refresh_osts_from_pool(tgt_pools);
- while (tgt_pools->pl_ostnr == 0) {
- LX_ERROR("target pool '%s' is empty, waiting %d seconds\n",
- tgt_pools->pl_pool, opt.o_pool_refresh);
+ /* wait till the slow pool got one OST at least */
+ lamigo_refresh_osts_from_pool(slow_pools);
+ while (slow_pools->pl_ostnr == 0) {
+ LX_ERROR("slow pool '%s' is empty, waiting %d seconds\n",
+ slow_pools->pl_pool, opt.o_pool_refresh);
sleep(opt.o_pool_refresh);
- lamigo_refresh_osts_from_pool(tgt_pools);
+ lamigo_refresh_osts_from_pool(slow_pools);
}
/* refresh fast pools */
LX_DEBUG("check hot "DFID": H: %Lu/%Lu, P: %Lu/%Lu, L %d, I %d %s\n",
PFID(&ht->ah_fid),
ht->ah_heat[0], ht->ah_heat[1], ht->ah_pools[ALR_FAST],
- ht->ah_pools[1], ht->ah_livetime, ht->ah_idle,
+ ht->ah_pools[ALR_SLOW], ht->ah_livetime, ht->ah_idle,
ht->ah_mark ? "M" : "");
if (ht->ah_mark & ALR_TAG_PROCESSED) {
/* already tried to replicate */
* replica preferred
*/
if (ht->ah_heat[0] && ht->ah_heat[1] == 0 &&
- ht->ah_pools[ALR_FAST] == 0 && ht->ah_pools[1]) {
- sync = lamigo_is_in_sync(&ht->ah_fid, tgt_pools, fast_pools, &mo);
+ ht->ah_pools[ALR_FAST] == 0 && ht->ah_pools[ALR_SLOW]) {
+ sync = lamigo_is_in_sync(&ht->ah_fid, slow_pools, fast_pools, &mo);
LX_DEBUG("try to replicate RO "DFID": %d\n",
PFID(&ht->ah_fid), sync);
if (sync != AMIGO_RESYNC_NONE) {
* try if it's still open
*/
if (ht->ah_idle > 0 && ht->ah_heat[1] &&
- ht->ah_pools[ALR_FAST] == 0 && ht->ah_pools[1]) {
- sync = lamigo_is_in_sync(&ht->ah_fid, tgt_pools, fast_pools, &mo);
+ ht->ah_pools[ALR_FAST] == 0 && ht->ah_pools[ALR_SLOW]) {
+ sync = lamigo_is_in_sync(&ht->ah_fid, slow_pools, fast_pools, &mo);
LX_DEBUG("try to replicate RW "DFID": %d\n",
PFID(&ht->ah_fid), sync);
if (sync != AMIGO_RESYNC_NONE) {
/* the file stored on cold pool was hat,
* now it's idling, try to move it to hot pool */
if (ht->ah_idle > 0 && ht->ah_heat[1] &&
- ht->ah_pools[1] == 0 && ht->ah_pools[ALR_FAST]) {
+ ht->ah_pools[ALR_SLOW] == 0 && ht->ah_pools[ALR_FAST]) {
sync = lamigo_is_in_sync(&ht->ah_fid, fast_pools,
- tgt_pools, &mo);
+ slow_pools, &mo);
LX_DEBUG("replicate idling hot to CP "DFID": %d\n",
PFID(&ht->ah_fid), sync);
if (sync != AMIGO_RESYNC_NONE) {
lamigo_new_job_for_hot(&ht->ah_fid, sync,
- tgt_pools, mo.mo_stripes);
+ slow_pools, mo.mo_stripes);
stats.s_replicate_rw2cold++;
}
/* XXX: mark existing replica preferred if it's not */
for (i = 0; i < nr; i++) {
struct alr_heat *ah = ht + i;
LX_DEBUG("idle "DFID": P: %Lu/%Lu, live %d, idle %d\n",
- PFID(&ah->ah_fid), ah->ah_pools[ALR_FAST], ah->ah_pools[1],
+ PFID(&ah->ah_fid), ah->ah_pools[ALR_FAST], ah->ah_pools[ALR_SLOW],
ah->ah_livetime, ah->ah_idle);
if (fast_pools->pl_open)
lamigo_check_hot_one(ht + i);
- if (tgt_pools->pl_open)
+ if (slow_pools->pl_open)
lamigo_check_hot_on_cold(ht + i);
}
free(ht);
lamigo_refresh_pool_statfs(pl, opt.o_src_free);
pl = pl->pl_next;
}
- pl = tgt_pools;
+ pl = slow_pools;
while (pl) {
lamigo_refresh_pool_statfs(pl, opt.o_tgt_free);
pl = pl->pl_next;