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

Warn if consistency level is overridden #325

Merged

Conversation

dkropachev
Copy link
Collaborator

@dkropachev dkropachev commented Aug 22, 2024

Closes #304

In some cases consistency level is being lost, which is not obvious to the user.
To remedy that we will issue a log working when it is happening.

Addresses following cases:

SimpleStatement simpleStatement = SimpleStatement.builder("SELECT * FROM some_table WHERE a = ?")
    .setConsistencyLevel(DefaultConsistencyLevel.QUORUM).build();
PreparedStatement prepared = session.prepare(simpleStatement);

And

  SimpleStatement simpleStatement = SimpleStatement.builder("SELECT * FROM some_table WHERE a = ?")
    .setConsistencyLevel(DefaultConsistencyLevel.QUORUM).build();
  batchStatementBuilder.addStatement(simpleStatement);
  batchStatementBuilder.build();

@dkropachev dkropachev force-pushed the dk/4-x-warn-if-consistency-level-is-overriden branch 7 times, most recently from e591e16 to 23b5dfb Compare August 25, 2024 01:19
@dkropachev dkropachev self-assigned this Aug 25, 2024
@dkropachev dkropachev force-pushed the dk/4-x-warn-if-consistency-level-is-overriden branch from 23b5dfb to 36e6dad Compare August 25, 2024 12:56
Copy link
Collaborator

@Bouncheck Bouncheck left a comment

Choose a reason for hiding this comment

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

I've left a comment on DefaultPrepareRequest file

non-default consistancy level is in the batch

When user does:
```
  SimpleStatement simpleStatement = SimpleStatement.builder("SELECT * FROM some_table WHERE a = ?")
    .setConsistencyLevel(DefaultConsistencyLevel.QUORUM).build();
  batchStatementBuilder.addStatement(simpleStatement);
  batchStatementBuilder.build();
```

Child statement looses it's consistancy level, which is confusing.
To warn user it is happening driver will issue log warning.
@dkropachev dkropachev force-pushed the dk/4-x-warn-if-consistency-level-is-overriden branch from 36e6dad to 642ba46 Compare August 27, 2024 01:39
@dkropachev dkropachev merged commit c7d60a5 into scylla-4.x Aug 27, 2024
10 of 11 checks passed
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.

2 participants