tikv / tikv

Distributed transactional key-value database, originally created to complement TiDB

Home Page:https://tikv.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

In-memory Engine: SELECT command denied to user 'root'@'%

overvenus opened this issue · comments

Bug Report

The root user cannot log in to TiDB during benchmarking of the In-Memory Engine (IME).

It appears that IME loads system tables into the cache and somehow discards records, causing TiDB to be unable to read the root user's record.

After restart TiDB and TiKV, the issue is gone.

Logs from TiDB:

[2024/06/17 21:38:32.654 +00:00] [WARN] [pd.go:168] ["get timestamp too slow"] [conn=3234035662] [session_alias=] ["cost time"=47.319333ms]
[2024/06/17 21:38:32.761 +00:00] [INFO] [executor.go:1416] ["limit executor close takes a long time"] [elapsed=1.012343ms]
[2024/06/17 21:38:34.397 +00:00] [INFO] [executor.go:1416] ["limit executor close takes a long time"] [elapsed=7.453043ms]
[2024/06/17 21:38:34.813 +00:00] [WARN] [session.go:2116] ["compile SQL failed"] [conn=3234037214] [session_alias=] [error="[planner:1142]SELECT command denied to user 'root'@'%' for table 'stock'"] [SQL="UPDATE stock SET s_quantity = ?, s_ytd = s_ytd + ?, s_order_cnt = s_order_cnt + 1, s_remote_cnt = s_remote_cnt + ? WHERE s_i_id = ? AND s_w_id = ?"]
[2024/06/17 21:38:34.813 +00:00] [WARN] [session.go:2116] ["compile SQL failed"] [conn=3234036294] [session_alias=] [error="[planner:1142]INSERT command denied to user 'root'@'%' for table 'order_line'"] [SQL="INSERT into order_line (ol_o_id, ol_d_id, ol_w_id, ol_number, ol_i_id, ol_supply_w_id, ol_quantity, ol_amount, ol_dist_info) VALUES (?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?)"]
[2024/06/17 21:38:34.813 +00:00] [WARN] [session.go:2116] ["compile SQL failed"] [conn=3234036388] [session_alias=] [error="[planner:1142]SELECT command denied to user 'root'@'%' for table 'customer'"] [SQL="SELECT c_id FROM customer WHERE c_w_id = ? AND c_d_id = ? AND c_last = ? ORDER BY c_first"]
[2024/06/17 21:38:34.813 +00:00] [WARN] [session.go:2116] ["compile SQL failed"] [conn=3234037070] [session_alias=] [error="[planner:1142]SELECT command denied to user 'root'@'%' for table 'stock'"] [SQL="UPDATE stock SET s_quantity = ?, s_ytd = s_ytd + ?, s_order_cnt = s_order_cnt + 1, s_remote_cnt = s_remote_cnt + ? WHERE s_i_id = ? AND s_w_id = ?"]
...
[2024/06/17 21:40:01.121 +00:00] [WARN] [gc_worker.go:274] ["check leader"] [category="gc worker"] [error="[kv:1062]Duplicate entry 'tikv_gc_leader_uuid' for key 'tidb.PRIMARY'"]
...
[2024/06/17 21:42:16.098 +00:00] [INFO] [refresher.go:120] ["No table to analyze"] [category=stats]

What version of TiKV are you using?

Nightly, built on #16868 83a419d

Steps to reproduce

TiKV Config

[range-cache-engine]
  enabled = true
  hard-limit-threshold = "8GB"
  soft-limit-threshold = "5GB"

TPCC commands

/root/.tiup/components/bench/v1.12.0/go-tpc \
    tpcc prepare \
    -H $HOST -P $PORT \
    -D tpcc50 --warehouses 50 -T 100

What did you expect?

No such error.