-
Notifications
You must be signed in to change notification settings - Fork 225
Failpoint
client-go
uses pingcap/failpoint
for failpoint injections, which are mainly used for tests.
As a library, client-go
expects the failpoints defined there can be triggered by external users. For this reason, the usage of failpoints in client-go
differs from the official recommendation.
Specifically, instead of relying on code generation, client-go
's failpoint uses EvalFailpoint
directly to determine whether a failpoint has been injected.
Obviously this poses a performance issue, so we define an additional short-circuit flag that makes client-go
skip all failpoint checks under normal circumstances. If the library user needs to use failpoint (usually in tests), then it is responsible for calling EnableFailpoints()
to turn off the short-circuit flag.
Note in particular that EnableFailpoints()
needs to be called before any client code is used to avoid data race.
Feel free to help improving! Minor changes are warmly welcomed. Just simply click edit!
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Contents
- Client-Go Wiki
- Compatibility
- API V2
- Transactional API
- RawKV API
- Configurations
- Utilities