Can the specific data be identified through the indexValues?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 能通过indexValues值找出是哪一条数据吗

| username: 舞动梦灵

In the TiDB log, I see information about write conflicts and index conflicts. I want to find out what data corresponds to the indexValues. How can I check this? How can I determine whether this data was successfully inserted?

[2024/01/13 10:15:51.856 +08:00] [WARN] [session.go:461] [sql] [conn=742556] [label=general] [error=“[kv:9007]Write conflict, txnStartTS=446984917998895106, conflictStartTS=446984917998895106, conflictCommitTS=446984917998895106, key={tableID=104, indexID=1, indexValues={a6bc6fe325a44ad29004a451ac9cd134, }} primary={tableID=104, indexID=1, indexValues={a6bc6fe325a44ad29004a451ac9cd134, }} [try again later]”] [txn=“Txn{state=invalid}”]

| username: dba远航 | Original post link

It is possible to find the table and index using tableID=104 and indexID=1, but it might be difficult to find the specific values.

| username: wangccsy | Original post link

Theoretically, it is possible.

| username: 舞动梦灵 | Original post link

I saw in the official documentation: * key={tableID=47, indexID=1, indexValues={string, }}: indicates the conflicting data in the current transaction. tableID represents the ID of the table where the conflict occurred, indexID indicates that the conflict occurred in the index data. If the conflict occurs in the data, it will print handle=x to indicate which row of data has the conflict, and indexValues represents the index data that has the conflict.
I also thought it was possible to see the index data, but I couldn’t find relevant information about indexvalues in the official documentation.

| username: linnana | Original post link

In the new version, data write conflicts occur. Can the TiDB server logs show the SQL statements?

| username: 舞动梦灵 | Original post link

I’m only on version 4.0.

| username: 舞动梦灵 | Original post link

Found it. indexValues={a6bc6fe325a44ad29004a451ac9cd134, this is the actual value in the corresponding table. No internal conversion needed :joy: Sorry for bothering everyone.

| username: 江湖故人 | Original post link

If this field contains sensitive information, it might not be a good idea to print it to the log :thinking:

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.