-
Notifications
You must be signed in to change notification settings - Fork 4.1k
workload/schemachange: knob improvements #57300
Description
Describe the problem
High error rates can be observed because of the number of times a certain op calls og.produceError or og.pxtExisting. For example, if the "error-rate" param is 10, each call to those functions will produce some unfavourable result 10% of the time. Some op functions can make several calls to those (eg. createView calls those functions in a loop), which makes the error rate of those op functions very high.
This is a problem because we want intentional errors to occur occasionally, but not so much that ops never alter the state of the database (which would only happen on op function success).
Furthermore, some errors are less interesting. A lot of ops follow the pattern where we call og.randTable(tx, og.pctExisting(true), ""), and then we return early while expecting a pgcode.UndefinedTable if the table does/doesn't exist. Because this pattern occurs in several ops (so pgcode.UndefinedTable errors are likely) and because pgcode.UndefinedTable is less interesting than say pgcode.CheckViolation, we should turn down its chance of occurring in individual ops.
The best way to deal with this would be to create more knobs and pick sensible defaults for them. For example, calls to og.randTable can use a different, lower, value than the "error-rate".
Jira issue: CRDB-2836