Get desktop application:
View/edit binary Protocol Buffers messages
Hooks allow injecting actions at specific points of the code. Useful for error injection.
Used in: , , , , , , ,
At which point in the code should the hook execute
What conditions activate the hook
Only used for EQUALS_BOTH
What should the hook do
Parameterise the hook's action - see HookAction for how these apply
Used in:
Fail the transaction immediately, make no attempt to roll it back, app gets TransactionFailed exception Txn will be left in whatever state it reached. This is not a real-world exception that would ever be voluntarily raised in the transaction library. It is designed to simulate an application hard crashing, or similar. In the real-world these should be fairly rare cases, so this shouldn't be the first error class reached for by a test, but it is important to check them.
This simulates any exception that doesn't fall into one of the other FAIL_ categories.
Simulates a failure that is likely to be transient, such as a SDK returning an unambiguous TimeoutException as server repeatedly returning a TEMP_FAIL
Inject an error indicating that operation was ambiguously successful. Some real-world examples that would cause this: Server returning ERR_AMBIG durable write error SDK returning an ambiguous TimeoutException, e.g. the server did not respond on a mutation
Inject an error that the doc already existed.
Inject an error that the doc was not found.
Inject an error that the path already exists.
Inject an error that the path was not found.
Inject an error that there was a CAS mismatch..
Mutate the doc using a regular KV SET. hookActionParam1 - the doc's id is sent in hookActionParam1, in format "bucket-name/collection-name/doc-id". e.g. "my-bucket/_default/some-doc-id" hookActionParam2 - the JSON to write
Remove the doc using a regular KV op. hookActionParam1 - the doc's id is sent in hookActionParam1, in format "bucket-name/collection-name/doc-id". e.g. "my-bucket/_default/some-doc-id"
Just return value in hookActionParam1
Add a blocking wait. The wait is hookActionParam1, converted to an int, in millis.
Used in:
Tracks each call to the hook, and triggers it on a particular run. Set which run with hookConditionParam1. Call count is 1-based indexing.
Use is HookPoint specific, but generally it's whether some variable equals hookConditionParam1 or hookConditionParam2
Use is HookPoint specific, and only used for HookPoint HAS_EXPIRED, which needs to check whether both docId==hookConditionParam2 and hookStage==hookConditionParam3
Combines ON_CALL and EQUALS. Note that this tracks how many calls have been made to this hook _using a given param_.
Similar to ON_CALL but triggers for all attempts less than or equal to hookConditionParam1 (1-indexed)
Similar to ON_CALL but triggers for all attempts greater than or equal to hookConditionParam1 (1-indexed)
Executes the hook as long as the transaction has not expired.
Executes the hook while the transaction is expired.
Generally the BEFORE_ hook is used to inject an error, e.g. as if the server had returned a failure The AFTER_ hook is used for ambiguity testing. E.g. the op succeeded but FAIL_AMBIGUOUS was returned.
Used in:
The BEFORE_UNLOCK_ hooks are deprecated, removed from ExtThreadSafety, and FIT will not send them. Performers do not need to implement them, and can remove them.
Injects that the transaction has expired at a certain point Does not take a HookAction hookConditionParam2 determines the hook point
Overrides the ATR id chosen for a given vbucket
Cleanup hooks
Client record hooks
No longer exists as of TXNJ-274