Skip to content

Conversation

@aweisberg
Copy link
Contributor

@aweisberg aweisberg commented Dec 12, 2022

@aweisberg aweisberg changed the base branch from trunk to cep-15-accord December 12, 2022 17:56
@aweisberg aweisberg changed the title CASSANDRA-18100 CASSANDRA-18100 CAS and serial read support for Accord Dec 12, 2022
@aweisberg aweisberg requested a review from maedhroz December 12, 2022 22:22
count.incrementAndGet();
return actual.call();
}
}
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

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

Copy link
Contributor Author

@aweisberg aweisberg Jan 19, 2023

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.

Copy link
Contributor

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.

Copy link
Contributor

@maedhroz maedhroz Jan 19, 2023

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

return operator.isSatisfiedBy(type, otherValue, value);
}

void checkForUnsetValues(List<ByteBuffer> values)
Copy link
Contributor

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().

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

@maedhroz maedhroz left a comment

Choose a reason for hiding this comment

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

LGTM

@aweisberg aweisberg force-pushed the cassandra-18100 branch 3 times, most recently from b37f296 to 0a88b08 Compare January 19, 2023 22:25
patch by Ariel Weisberg; Reviewed by Caleb Rackliffe for CASSANDRA-18100
@aweisberg
Copy link
Contributor Author

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