Enable taskstat accounting for versions >= 3

Previously if clickhouse was compiled under a kernel with higher
TASKSTATS_VERSION, but run under a kernel with older TASKSTAT_VERSION
extended and io accounting would be disabled.
This commit is contained in:
Nicolae Vartolomei 2019-02-28 21:49:52 +00:00
parent a4e56478ca
commit 602aeb3bb2
No known key found for this signature in database
GPG Key ID: C8E7675B7C70A0E0

View File

@ -137,8 +137,8 @@ struct TasksStatsCounters
profile_events.increment(ProfileEvents::OSCPUVirtualTimeMicroseconds,
safeDiff(prev.stat.cpu_run_virtual_total, curr.stat.cpu_run_virtual_total) / 1000U);
/// Too old struct version, do not read new fields
if (curr.stat.version < TASKSTATS_VERSION)
/// Since TASKSTATS_VERSION = 3 extended accounting and IO accounting is available.
if (curr.stat.version < 3)
return;
profile_events.increment(ProfileEvents::OSReadChars, safeDiff(prev.stat.read_char, curr.stat.read_char));