Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: 关于tinysql project3的test问题
|
username: 赖沐曦_bullfrog
I have a question. The first issue is a panic that occurs in proj3, specifically in store/tikv/snapshot.go, and it appears to be related to proj6. The second issue is that sometimes the test gets stuck. After commenting out the panic() in snapshot.go, both issues no longer occur. Is this a problem with the code framework’s calls?
The commented code is as follows:
func (s *tikvSnapshot) get(bo *Backoffer, k kv.Key) ([]byte, error) {
// ....omitted
if keyErr := cmdGetResp.GetError(); keyErr != nil {
// You need to handle the key error here
// If the key error is a lock, there are 2 possible cases:
// 1. The transaction is during commit, wait for a while and retry.
// 2. The transaction is dead with some locks left, resolve it.
// YOUR CODE HERE (proj6).
// Commented out the following panic line
//panic("YOUR CODE HERE")
continue
}
return val, nil
}
}
Another issue is in the test TestAddColumn, which has a piece of code that creates a table. I checked the call chain, and in this action, there are calls to the native framework’s code, but there is a small probability of errors: