diff --git a/src/box/vy_scheduler.c b/src/box/vy_scheduler.c index 140d289f8b00da7842205adefece5fdb3063d750..9563508cd8ec574571181fc4ef72da34fa36d0e6 100644 --- a/src/box/vy_scheduler.c +++ b/src/box/vy_scheduler.c @@ -1239,7 +1239,12 @@ vy_task_dump_complete(struct vy_task *task) } lsm->dump_lsn = MAX(lsm->dump_lsn, dump_lsn); vy_lsm_acct_dump(lsm, &dump_input, &dump_output); - scheduler->stat.dump_input += dump_input.bytes; + /* + * Indexes of the same space share a memory level so we + * account dump input only when the primary index is dumped. + */ + if (lsm->index_id == 0) + scheduler->stat.dump_input += dump_input.bytes; scheduler->stat.dump_output += dump_output.bytes; /* The iterator has been cleaned up in a worker thread. */ diff --git a/test/vinyl/stat.result b/test/vinyl/stat.result index e8780e5bdca9e13cab5cd4eab99ba8c5370b611d..3050e43d5d11b0d4a7236bbbc54be3d483950f6a 100644 --- a/test/vinyl/stat.result +++ b/test/vinyl/stat.result @@ -1125,7 +1125,7 @@ box.snapshot() stat_diff(gstat(), st, 'scheduler') --- - dump_count: 1 - dump_input: 208400 + dump_input: 104200 dump_output: 103592 ... for i = 1, 100, 10 do s:replace{i, i, string.rep('y', 1000)} end @@ -1141,7 +1141,7 @@ box.snapshot() stat_diff(gstat(), st, 'scheduler') --- - dump_count: 1 - dump_input: 21230 + dump_input: 10420 dump_output: 10371 ... st = gstat()