pingcap / tidb

TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try AI-powered Chat2Query free at : https://www.pingcap.com/tidb-serverless/
https://pingcap.com
Apache License 2.0
37.11k stars 5.83k forks source link

Items in slow log file may not be ordered by time #34381

Open time-and-fate opened 2 years ago

time-and-fate commented 2 years ago

Enhancement

When doing some tests, we met a case where the slow query items in the slow log are not ordered by time. This is in contradiction with the assumptions in the slow_query system table logic.

This makes queries like select xxx from slow_query where time = xxx return an empty result when there're slow query items satisfying the condition in fact.

The slow log file is attached below and is not manually modified. We need to investigate why this happened and how to avoid this.

tidb_slow_query.log

crazycs520 commented 2 years ago

related issue: https://github.com/uber-go/zap/issues/1094