Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Scan Server discussion #4430

Draft
wants to merge 1 commit into
base: 2.1
Choose a base branch
from

Conversation

ddanielr
Copy link
Contributor

@ddanielr ddanielr commented Apr 3, 2024

Added client property for a list of tables that support eventual scanning.

Scanning level can be overridden by calling setConsistencyLevel() on the created scanner object.

Added client property for a list of tables that support eventual
scanning.

Scanning level can be overridden by calling setConsistencyLevel()
on the created scanner object.
@ddanielr
Copy link
Contributor Author

ddanielr commented Apr 3, 2024

This is an example of defining which tables the scanner should use eventual scan consistency vs immediate.
This allows the client code behavior to be modified based on properties vs a client source code change.

The downside to this is that multiple clients with different properties will return different scan results.

A different implementation could set the allowed scan behavior at the table prop level so users can enable scan servers to use individual tables as the data in the system grows over time.

@@ -91,6 +91,8 @@ public enum ClientProperty {
// Scanner
SCANNER_BATCH_SIZE("scanner.batch.size", "1000", PropertyType.COUNT,
"Number of key/value pairs that will be fetched at time from tablet server", "2.0.0", false),
SCANNER_CONSISTENCY_SCAN_LEVEL("scanner.consistency.level.eventual", "", PropertyType.STRING,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if SCANNER should be the prefix for this or SCAN_SERVER.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also the overall general name could be improved.

@dlmarion
Copy link
Contributor

dlmarion commented Apr 3, 2024

I'm not sure I fully understand how this property is used. Does this provide a default consistencyLevel setting in the client for the configured tables? If so, then I think this might cause issues in a multi-tenant situation if you have different applications running from the same client host / configuration. Lets say you have two apps (appA and appB). appA is time-sensitive and cannot afford eventual consistency. If appA and appB were to run from the same host/configuration for whatever reason, then that would present a problem for appA. Making the application change the code to use the consistency level feature allows the developers of the application to make an informed choice based on the behavior and requirements of their application. It allows them to opt-in to using the feature.

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.

None yet

2 participants