Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upCode hacks
Inject a retryable error in an UPDATE statement on a marked row
Add the following snippet above https://github.com/cockroachdb/cockroach/blob/ef7138bc3fd7261ac40f84762c87f45846f41fe4/cli/start.go#L171
+ // !!!
+ restarted := false
+ cliContext.TestingKnobs.StoreTestingKnobs.TestingCommandFilter =
+ func(args storageutils.FilterArgs) *roachpb.Error {
+ switch req := args.Req.(type) {
+ case *roachpb.PutRequest:
+ if bytes.Contains(req.Value.RawBytes, []byte("marker")) && !restarted {
+ log.Infof("!!! injecting retry error")
+ restarted = true
+ return roachpb.NewErrorWithTxn(
+ roachpb.NewTransactionRetryError(), args.Hdr.Txn)
+ }
+ }
+ return nil
+ }
Press h to open a hovercard with more details.