fellow_cache: fix obj_chg threshold - include del_thin

parent 9c82b0aa
......@@ -5877,7 +5877,7 @@ fellow_logwatcher_need_openlog(const struct fellow_logbuffer *lbuf,
const struct dle_stats *s;
float ratio;
unsigned alive, n, a;
size_t sz;
size_t sz, sum;
// XXX config
const unsigned thr_logregion_rewrite_pct = 50;
......@@ -5933,11 +5933,12 @@ fellow_logwatcher_need_openlog(const struct fellow_logbuffer *lbuf,
*/
sz = logbuffer_max_obj_chg(lbuf);
sum = s->obj_del_thin;
sum += s->obj_chg;
if (s->obj_chg >= sz) {
if (sum >= sz) {
if (why) {
bprintf(why->s, "obj_chg %u > %zu",
s->obj_chg, sz);
bprintf(why->s, "dle_chg %zu > %zu", sum, sz);
}
return (FLW_NEED_REWRITE);
}
......@@ -6778,7 +6779,8 @@ fellow_log_dle_submit(struct fellow_fd *ffd,
* underway, wait for the new log to appear
*/
if (prep->dle_stats.obj_chg > 0 &&
ffd->logbuf->dle_stats.obj_chg
((size_t)ffd->logbuf->dle_stats.obj_chg +
ffd->logbuf->dle_stats.obj_del_thin)
>= logbuffer_max_obj_chg(ffd->logbuf)) {
if (ffd->rewriting) {
AZ(pthread_cond_wait(&ffd->new_logbuf_cond,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment