Tikv: Region written stats is abnormal

Created on 12 Mar 2021  路  7Comments  路  Source: tikv/tikv

Bug Report

What version of TiKV are you using?

Versions that I know of: 4.0.10, 5.0.0-rc

What operating system and CPU are you using?

Steps to reproduce

What did you expect?

Value of region written bytes make sense, and is relatively stable.

What did happened?

In this case (5.0.0-rc), service is running normally, but region written bytes reach multiple PBs

image

In this case (4.0.10), two down servers worsen the abnormal state

image

severitmoderate typbug

All 7 comments

In one of the cases, the tikv_region_written_bytes_sum value is 1.8e19, it's likely a u64 overflow, possibly caused by written_bytes_delta calculation during heartbeat task.

Because the average written bytes keeps growing, and it's calculated by

let written_bytes = current_written_bytes - last_written_bytes;
last_written_bytes = current_written_bytes;

. If it's underflow, then current_written_bytes keeps decreasing for more than 5 hours, which doesn't seem reasonable.

@BusyJay Are you referring to the second screenshot? I recheck the metrics, it seems like something wrong with grafana, the linear graph is a display error:

image

So it seems like the metrics is not updated for 5 hours, and then hit underflow?

Is the region scheduling affected by these stats?

/severity moderate

If metrics is not updated for 5 hours, then either the clock of the prometheus machine jumps or tikv/pd thread is stuck for 5 hours. If the latter is the case, and only pd thread is stuck, then scheduling will not work for the time; if tikv is stuck, then it should be completely out of service.

If metrics is not updated for 5 hours, then either the clock of the prometheus machine jumps or tikv/pd thread is stuck for 5 hours. If the latter is the case, and only pd thread is stuck, then scheduling will not work for the time; if tikv is stuck, then it should be completely out of service.

I think during this 5 hours the two problematic servers stayed down, thus no metrics reporting.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

elimist3 picture elimist3  路  3Comments

AndreMouche picture AndreMouche  路  8Comments

hicqu picture hicqu  路  5Comments

fredchenbj picture fredchenbj  路  8Comments

abo picture abo  路  8Comments