if (src_pools->pl_open) {
/* get most recent hot files */
ht = lamigo_get_hot(alr_hot_period, &nr);
- LX_DEBUG("check hot in period %lu - %d\n",
- alr_hot_period, nr);
if (ht) {
+ LX_DEBUG("check hot in period %lu - %d\n",
+ alr_hot_period, nr);
for (i = 0; i < nr; i++)
lamigo_check_hot_one(ht + i);
free(ht);
/* now check hot idling files - the files we found hot and
* skipped replication. now it's time to try again */
ht = lamigo_get_hot(alr_hot_period - opt.o_alr_hot_after_idle, &nr);
- LX_DEBUG("check idle in period %lu - %d\n",
- alr_hot_period - 3, nr);
if (!ht)
goto out;
+ LX_DEBUG("check idle in period %lu - %d\n",
+ alr_hot_period - 3, nr);
for (i = 0; i < nr; i++) {
struct alr_heat *ah = ht + i;
LX_DEBUG("idle "DFID": P: %Lu/%Lu, live %d, idle %d\n",
static void lamigo_refresh_pool_statfs(struct pool_list *pl, int threshold)
{
__u64 tavail = 0, ttotal = 0; /* sum for the pool */
+ bool old_status;
int i;
pthread_rwlock_rdlock(&pl->pl_lock);
/* check OSP is active */
active = lamigo_read_osp_param(ostidx, "active");
status = lamigo_read_osp_param(ostidx, "prealloc_status");
- LX_DEBUG("statfs for %d%s/%d: %llu from %llu\n",
- ostidx, active ? "(active)" : "(inactive)",
- (int)status, kbavail, kbtotal);
if (!active || status)
continue;
tavail += kbavail;
pthread_rwlock_unlock(&pl->pl_lock);
pl->pl_total = ttotal;
pl->pl_avail = tavail;
+ old_status = pl->pl_open;
if (ttotal == 0 || (tavail < ttotal * threshold / 100))
pl->pl_open = false;
else
pl->pl_open = true;
/* whether pool is good for replicas */
- LX_DEBUG("statfs for %s %s pool: %llu from %llu, thresh %llu\n",
- pl->pl_open ? "open" : "closed", pl->pl_pool, tavail,
- ttotal, ttotal * threshold / 100);
+ if (old_status != pl->pl_open)
+ LX_DEBUG("statfs for %s %s pool: %llu from %llu, thresh %llu\n",
+ pl->pl_open ? "open" : "closed", pl->pl_pool, tavail,
+ ttotal, ttotal * threshold / 100);
}
static void lamigo_refresh_statfs(void)