client-go icon indicating copy to clipboard operation
client-go copied to clipboard

txn: seperate prewrite and commit in detail information and add clone methods

Open cfzjywxk opened this issue 3 years ago • 0 comments

Ref: https://github.com/tikv/tikv/issues/12362

As the CommitDetails is changed and it's directly used in the tidb code, this is a breaking change.

  • Separate the prewrite and commit related details in execDetail. So it's more clear for the 2pc mode committed transactions.
{
   "prewrite":14.6ms,
   "get_commit_ts":521.9µs,
   "commit":6.67ms,
   "slowest_prewrite_rpc":{
      "total":0.015s,
      "region_id":2,
      "store":"127.0.0.1":20160,
      "tikv_wall_time":13.4ms,
      "scan_detail":{
         "get_snapshot_time":409µs,
         "rocksdb":{
            "block":{
               
            }
         }
      },
      "write_detail":{
         "store_batch_wait":246.3µs,
         "propose_send_wait":0s,
         "persist_log":{
            "total":8.82ms,
            "write_leader_wait":5.39µs,
            "sync_log":7.83ms,
            "write_memtable":76.1µs
         },
         "commit_log":9.31ms,
         "apply_batch_wait":179.8µs,
         "apply":{
            "total":1.01ms,
            "mutex_lock":654ns,
            "write_leader_wait":0s,
            "write_wal":179.8µs,
            "write_memtable":33.7µs
         }
      }
   },
   "commit_primary_rpc":{
      "total":0.007s,
      "region_id":2,
      "store":"127.0.0.1":20160,
      "tikv_wall_time":5.58ms,
      "scan_detail":{
         "get_snapshot_time":326µs,
         "rocksdb":{
            "block":{
               
            }
         }
      },
      "write_detail":{
         "store_batch_wait":292.6µs,
         "propose_send_wait":0s,
         "persist_log":{
            "total":1.72ms,
            "write_leader_wait":3.82µs,
            "sync_log":998.1µs,
            "write_memtable":51.3µs
         },
         "commit_log":2.08ms,
         "apply_batch_wait":146.6µs,
         "apply":{
            "total":799.7µs,
            "mutex_lock":625ns,
            "write_leader_wait":0s,
            "write_wal":146.6µs,
            "write_memtable":37.7µs
         }
      }
   },
   "region_num":1,
   "write_keys":1,
   "write_byte":29
}
  • Implement the actual Clone methods for several structs.

Signed-off-by: cfzjywxk [email protected]

cfzjywxk avatar Aug 16 '22 09:08 cfzjywxk