Skip to content

Conversation

@ArbaazKhan1
Copy link
Contributor

Closes issue #5057

Introduced a new metric to track the number of exceptions that occur within the scan executor. Allows for users to monitor exceptions thrown from the iterator stack, instead of relying on parsing logs.

Copy link
Contributor

@keith-turner keith-turner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to add an IT for this. Could look at the ITs that use the class TestStatsDSink for examples of how to create an IT that reads metrics.

Looked around for an IT that exercises scan executors and did not see one, its a purely performance feature and hard to test. Can look at these docs for info on setting up scan executors. Need to do something like the following in the IT.

  • Before the cluster starts set some tserver.scan.executors.<executor name>.threads=<num> props in the site config to create different named scan executors.
  • Create a few tables and set them to have different scan executors by setting the table.scan.dispatcher.opts.executor=<executor name> props.
  • Run a scan against a table w/ an iterator that will throw an exception. Check the metrics for errors for the executor the table was configured to use.

In a way this test will also help us verify that scan dispatching is working correctly and sending things to the expected executor on the server side.

@keith-turner
Copy link
Contributor

Not a change for this PR, but its interesting how this PR is tagging a metric w/ the scan executor name. Could potentially tag all scan metrics w/ the executor name.

@dlmarion
Copy link
Contributor

Be sure to run the MetricsIT and other Metrics-related ITs.

}

log.info("Waiting for metrics to be published...");
Thread.sleep(15_000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could make this test sporadically fail as it's assuming that all of the metrics will be published by this time. We have run into this before and the approach that we have taken with the other tests is to continue to get lines from the sink until we have seen the expected metrics. See MetricsIT for an example of this. You might want to perform the scan, check the metrics, then perform the batch scan and check those metrics.


// Create table with BadIterator configured for scan scope
NewTableConfiguration ntc = new NewTableConfiguration();
IteratorSetting badIterSetting = new IteratorSetting(50, "bad", BadIterator.class);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to use the ErrorThrowingIterator instead. This would allow you to insert M entries into the table and set the ErrorThrowingIterator to throw an exception N times. Then in the test you can confirm that you see N in the metrics and get M-N entries back in the scan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants