-
Notifications
You must be signed in to change notification settings - Fork 3.8k
CASSANDRA-18100 CAS and serial read support for Accord #2049
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
Conversation
a404fee to
8a593b0
Compare
8a593b0 to
ab3cfa3
Compare
test/unit/org/apache/cassandra/cql3/conditions/ColumnConditionTest.java
Outdated
Show resolved
Hide resolved
test/unit/org/apache/cassandra/cql3/conditions/ColumnConditionTest.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/cql3/statements/TransactionStatement.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/cql3/statements/TransactionStatement.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/cql3/statements/TransactionStatement.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/service/accord/AccordService.java
Outdated
Show resolved
Hide resolved
| count.incrementAndGet(); | ||
| return actual.call(); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have as one of the TODO items in CASSANDRA-18107 latency metrics recording in AccordService#coordinate(), probably as a "Transaction" item in ClientRequestsMetricsHolder. Maybe we could just throw that in here, avoid BB, and kill two birds w/ one stone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable. Do we want separate metrics for transactions that are write only since they generally have a very different latency profile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want separate metrics for transactions that are write only
I'm fine w/ having separate read-only, write-only, and "mixed" versions. It's nicer to have more granularity when we don't need it than less when we do :p
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks more complicated then just latency since it's counting a bunch of different things. Abort, timeout, unavailable, mutation size. I think we need to think a little harder about metrics for Accord transactions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, although we already handle similar concerns in CASClientWriteRequestMetrics -> CASClientRequestMetrics -> ClientRequestMetrics, where we distinguish between those things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine if you want to defer to CASSANDRA-18107
test/distributed/org/apache/cassandra/distributed/test/accord/AccordCQLTest.java
Outdated
Show resolved
Hide resolved
test/distributed/org/apache/cassandra/distributed/test/accord/AccordCQLTest.java
Outdated
Show resolved
Hide resolved
test/distributed/org/apache/cassandra/distributed/test/accord/AccordCQLTest.java
Show resolved
Hide resolved
src/java/org/apache/cassandra/service/accord/txn/TxnReference.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/service/accord/txn/TxnUpdate.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/service/accord/txn/TxnUpdate.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/service/accord/AccordService.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/service/accord/AccordSerializers.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/cql3/conditions/ColumnCondition.java
Outdated
Show resolved
Hide resolved
| return operator.isSatisfiedBy(type, otherValue, value); | ||
| } | ||
|
|
||
| void checkForUnsetValues(List<ByteBuffer> values) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this in place, do we still need the per-value checks in compareWithOperator()? I think the only thing we're not currently double-validating is the usage in TxnCondition#applies().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably redundant, but that is such a fast thing to check at runtime I think it's fine to do it in both?
I added this check and moved it earlier because I was unsure if we had those unset values in practice and in which types of bounds. It's a little easier to find out the unset value is unset when the bound is constructed rather than later when it is applied.
Don't feel strongly either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a little easier to find out the unset value is unset when the bound is constructed rather than later when it is applied.
Would it make sense to have the value == UNSET_BYTE_BUFFER check in the TxnCondition.Value constructor? We'd find out earlier I guess.
In terms of whether we'd want to remove the duplicate checks in compareWithOperator(), I'll leave it up to you. If I'm able to make it private again when I finish the CQL integration, perhaps I'd remove them, but I'm fine either way at this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For CQL3CasRequest this would be later not earlier? The bounds are created when the request is first created from the parser/planner bits.
src/java/org/apache/cassandra/cql3/conditions/ColumnCondition.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/cql3/conditions/ColumnCondition.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/cql3/conditions/ColumnCondition.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/cql3/conditions/ColumnCondition.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/cql3/conditions/ColumnCondition.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/cql3/conditions/ColumnCondition.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/cql3/conditions/ColumnCondition.java
Outdated
Show resolved
Hide resolved
973b85d to
ad14ce6
Compare
maedhroz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
b37f296 to
0a88b08
Compare
patch by Ariel Weisberg; Reviewed by Caleb Rackliffe for CASSANDRA-18100
0a88b08 to
00eea4c
Compare
cd3329f to
d67a8e2
Compare
|
Merged as a3ccd4d93d1e1ed3ca65e2c3ad3e0126a2c8bf8f |
CASSANDRA-18100