mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
support counter error handler name for cross-compatibility
This commit is contained in:
parent
d59f3f0d37
commit
3543dd8baf
@ -13,9 +13,10 @@ public enum ErrorResponse {
|
|||||||
retry("R"), // resubmit this operation up to the available tries
|
retry("R"), // resubmit this operation up to the available tries
|
||||||
histogram("H"), // record this metric in a histogram
|
histogram("H"), // record this metric in a histogram
|
||||||
count("C"), // count this metric separately
|
count("C"), // count this metric separately
|
||||||
|
counter("C"),
|
||||||
ignore("I"); // do nothing
|
ignore("I"); // do nothing
|
||||||
|
|
||||||
private String symbol;
|
private final String symbol;
|
||||||
|
|
||||||
ErrorResponse(String symbol) {
|
ErrorResponse(String symbol) {
|
||||||
this.symbol = symbol;
|
this.symbol = symbol;
|
||||||
|
@ -82,6 +82,7 @@ public class NBCycleErrorHandler implements CycleErrorHandler<Throwable, ErrorSt
|
|||||||
case histogram:
|
case histogram:
|
||||||
exceptionHistoMetrics.update(error,cce.getDurationNanos());
|
exceptionHistoMetrics.update(error,cce.getDurationNanos());
|
||||||
case count:
|
case count:
|
||||||
|
case counter:
|
||||||
exceptionCountMetrics.count(error);
|
exceptionCountMetrics.count(error);
|
||||||
case ignore:
|
case ignore:
|
||||||
default:
|
default:
|
||||||
|
@ -9,15 +9,15 @@ simply use one of these basic recipes in your activity parameters:
|
|||||||
# error and stop on *any exception
|
# error and stop on *any exception
|
||||||
# incidentally, this is the same as the deprecated diagnose=true option
|
# incidentally, this is the same as the deprecated diagnose=true option
|
||||||
errors=stop
|
errors=stop
|
||||||
|
|
||||||
# error and stop for (usually) unrecoverable errors
|
# error and stop for (usually) unrecoverable errors
|
||||||
# warn and retry everything else (this is actually the default)
|
# warn and retry everything else (this is actually the default)
|
||||||
|
|
||||||
errors=stop,retryable->retry
|
errors=stop,retryable->retry
|
||||||
|
|
||||||
# record histograms for WriteTimeoutException, error and stop
|
# record histograms for WriteTimeoutException, error and stop
|
||||||
# for everything else.
|
# for everything else.
|
||||||
|
|
||||||
errors=stop,WriteTimeoutException:histogram
|
errors=stop,WriteTimeoutException:histogram
|
||||||
|
|
||||||
As you can see, the error handling format is pretty basic. Behind this basic
|
As you can see, the error handling format is pretty basic. Behind this basic
|
||||||
@ -32,10 +32,10 @@ Anytime you assign a value to the *errors* parameter for a cql activity, you are
|
|||||||
replacing the default 'stop,retryable->retry,unverified->stop' configuration.
|
replacing the default 'stop,retryable->retry,unverified->stop' configuration.
|
||||||
That is, each time this value is assigned, a new error handler is configured and
|
That is, each time this value is assigned, a new error handler is configured and
|
||||||
installed according to the new value.
|
installed according to the new value.
|
||||||
|
|
||||||
### errors= parameter format
|
### errors= parameter format
|
||||||
|
|
||||||
The errors parameter contains a comma-separated list of one or more
|
The errors parameter contains a comma-separated list of one or more
|
||||||
handler assignments where the error can be in any of these forms:
|
handler assignments where the error can be in any of these forms:
|
||||||
|
|
||||||
- group name ( "unapplied" | "retryable" | "unverified" )
|
- group name ( "unapplied" | "retryable" | "unverified" )
|
||||||
@ -54,63 +54,66 @@ handler default for all non-specific errors in the form:
|
|||||||
|
|
||||||
# force the test to stop with any error, even retryable ones
|
# force the test to stop with any error, even retryable ones
|
||||||
errors=stop
|
errors=stop
|
||||||
|
|
||||||
### Error Handler Verbs
|
### Error Handler Verbs
|
||||||
|
|
||||||
When an error occurs, you can control how it is handled for the most part.
|
When an error occurs, you can control how it is handled for the most part.
|
||||||
This is the error handler stack:
|
This is the error handler stack:
|
||||||
|
|
||||||
- **stop** - logs an error, and then rethrows the causing exception,
|
- **stop** - logs an error, and then rethrows the causing exception,
|
||||||
causing nosqlbench to shutdown the current scenario.
|
causing nosqlbench to shutdown the current scenario.
|
||||||
- **warn** - log a warning in the log, with details about the error
|
- **warn** - log a warning in the log, with details about the error and
|
||||||
and associated statement.
|
associated statement.
|
||||||
- **retry** - Retry the operation if the number of retries hasn't been
|
- **retry** - Retry the operation if the number of retries hasn't been
|
||||||
used up *and* the causing exception falls in the set of
|
used up *and* the causing exception falls in the set of
|
||||||
*retryable* errors.
|
*retryable* errors.
|
||||||
- **histogram** - keep a histogram of the exception counts, under the
|
- **histogram** - keep a histogram of the exception counts, under the name
|
||||||
name errorhistos.classname, using the simple class name.
|
errorhistos.classname, using the simple class name. The magnitude of
|
||||||
The magnitude of these histos is how long the operation was pending
|
these histos is how long the operation was pending before the related
|
||||||
before the related error occurred.
|
error occurred.
|
||||||
- **count** - keep a count in metrics for the exception, under the name
|
- **count** - keep a count in metrics for the exception, under the name
|
||||||
errorcounts.classname, using the simple class name.
|
errorcounts.classname, using the simple class name.
|
||||||
|
- **counter** - same as **count**, added for compatibility with the newer
|
||||||
|
universal error handler. This one is the preferred name.
|
||||||
- **ignore** - do nothing, do not even retry or count
|
- **ignore** - do nothing, do not even retry or count
|
||||||
|
|
||||||
Each handling verb above is ordered from the most invasive to least
|
Each handling verb above is ordered from the most invasive to least
|
||||||
invasive starting at the top. With the exception of the **stop**
|
invasive starting at the top. With the exception of the **stop**
|
||||||
handler, the rest of them will be applied to an error all the way
|
handler, the rest of them will be applied to an error all the way to the
|
||||||
to the bottom. For now, the error handling stack is exactly as above.
|
bottom. For now, the error handling stack is exactly as above. You can't
|
||||||
You can't modify it, although it may be made configurable in the future.
|
modify it, although it may be made configurable in the future.
|
||||||
|
|
||||||
One way to choose the right handler is to say "How serious is this type
|
One way to choose the right handler is to say "How serious is this type of
|
||||||
of error to the test results if it happens?" In general, it is best
|
error to the test results if it happens?" In general, it is best to be
|
||||||
to be more conservative and choose a more aggressive setting unless you
|
more conservative and choose a more aggressive setting unless you are
|
||||||
are specifically wanting to measure how often a given error happens,
|
specifically wanting to measure how often a given error happens, for
|
||||||
for example.
|
example.
|
||||||
|
|
||||||
Each exception type will have one and only one error handler at all times.
|
Each exception type will have one and only one error handler at all times.
|
||||||
No matter how you set an error handler for a class, only the most
|
No matter how you set an error handler for a class, only the most recently
|
||||||
recently assigned handler stack will be active for it. This might be
|
assigned handler stack will be active for it. This might be important to
|
||||||
important to keep in mind when you make multiple assignments to potentially
|
keep in mind when you make multiple assignments to potentially overlapping
|
||||||
overlapping sets of error types. In any case, the default 'stop' handler
|
sets of error types. In any case, the default 'stop' handler will always
|
||||||
will always catch an error that does not otherwise have a more specific
|
catch an error that does not otherwise have a more specific handler
|
||||||
handler assigned to it.
|
assigned to it.
|
||||||
|
|
||||||
##### Error Types
|
##### Error Types
|
||||||
|
|
||||||
The errors that can be handled are simply all the exception types that
|
The errors that can be handled are simply all the exception types that can
|
||||||
can be thrown by either the DataStax Java Driver for DSE, *or* the
|
be thrown by either the DataStax Java Driver for DSE, *or* the nosqlbench
|
||||||
nosqlbench client itself. This includes errors that indicate a potentially
|
client itself. This includes errors that indicate a potentially
|
||||||
intermittent failure condition. It also includes errors that are more
|
intermittent failure condition. It also includes errors that are more
|
||||||
permanent in nature, like WriteFailure, which would continue to occur
|
permanent in nature, like WriteFailure, which would continue to occur on
|
||||||
on subsequent retries without some form of intervention. The nosqlbench
|
subsequent retries without some form of intervention. The nosqlbench
|
||||||
application will also generate some additional exceptions that capture
|
application will also generate some additional exceptions that capture
|
||||||
common error cases that the Java driver doesn't or shouldn't have a
|
common error cases that the Java driver doesn't or shouldn't have a
|
||||||
special case for, but which may be important for nosqlbench testing purposes.
|
special case for, but which may be important for nosqlbench testing
|
||||||
|
purposes.
|
||||||
|
|
||||||
In nosqlbench, all error handlers are specific to a particular kind of
|
In nosqlbench, all error handlers are specific to a particular kind of
|
||||||
exception that you would catch in a typical application that uses DSE,
|
exception that you would catch in a typical application that uses DSE,
|
||||||
although you can tell a handler to take care of a whole category
|
although you can tell a handler to take care of a whole category of
|
||||||
of problems as long as you know the right name to use.
|
problems as long as you know the right name to use.
|
||||||
|
|
||||||
##### Assigned by Java Exception Type
|
##### Assigned by Java Exception Type
|
||||||
|
|
||||||
@ -122,14 +125,14 @@ by a closer parent or directly.
|
|||||||
##### Assigning by Error Group Name
|
##### Assigning by Error Group Name
|
||||||
|
|
||||||
Error types for which you would commonly assign the same handling behavior
|
Error types for which you would commonly assign the same handling behavior
|
||||||
are also grouped in predefined names. If a handler is assigned to one
|
are also grouped in predefined names. If a handler is assigned to one of
|
||||||
of the group names, then the handler is assigned all of the exceptions
|
the group names, then the handler is assigned all of the exceptions in the
|
||||||
in the group individually. For example, 'errors=retryable=stop'
|
group individually. For example, 'errors=retryable=stop'
|
||||||
|
|
||||||
### Recognized Exceptions
|
### Recognized Exceptions
|
||||||
|
|
||||||
The whole hierarchy of exceptions as of DSE Driver 3.2.0 is as follows,
|
The whole hierarchy of exceptions as of DSE Driver 3.2.0 is as follows,
|
||||||
with the default configuration shown.
|
with the default configuration shown.
|
||||||
|
|
||||||
DriverException -> stop
|
DriverException -> stop
|
||||||
FrameTooLongException
|
FrameTooLongException
|
||||||
@ -188,11 +191,11 @@ handled alongside the normal exceptions as explained above.
|
|||||||
2. UnexpectedPaging - The UnexpectedPaging exception is meant to keep users from
|
2. UnexpectedPaging - The UnexpectedPaging exception is meant to keep users from
|
||||||
being surprised when there is paging activity in the workload, as this can have
|
being surprised when there is paging activity in the workload, as this can have
|
||||||
other implications for tuning and performance. See the details on the
|
other implications for tuning and performance. See the details on the
|
||||||
**maxpages** parameter, and the *fetch size* parameter in the java driver for
|
**maxpages** parameter, and the *fetch size* parameter in the java
|
||||||
details.
|
driver for details.
|
||||||
3. Unverified\* Exceptions - For data set verification; These exceptions
|
3. Unverified\* Exceptions - For data set verification; These exceptions
|
||||||
indicate when a cqlverify activity has found rows that differ from what
|
indicate when a cqlverify activity has found rows that differ from what
|
||||||
was expected.
|
was expected.
|
||||||
4. RetriesExhaustedException - Indicates that all retries were exhausted before
|
4. RetriesExhaustedException - Indicates that all retries were exhausted before
|
||||||
a given operation could complete successfully.
|
a given operation could complete successfully.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user