-
Notifications
You must be signed in to change notification settings - Fork 99
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
IGNITE-23748 Lock LWM when executing RO operation on data node #4974
base: main
Are you sure you want to change the base?
Conversation
056d370
to
9ff9923
Compare
* When executing an operation in an RO transaction (explicit or implicit), attempt to lock LWM on the data node where it's executed * If lock attempt fails, throw an exception with a specific error code * When cleaning up after an RO transaction had been finished, unlock LWM on each node where such a cleanup happens * For direct RO operations (which happen in implicit RO transactions), unlock LWM right after the read has been done on the data node
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 you have benchmark results that will show the difference for RO performance with and without proposed logic?
modules/client/src/test/java/org/apache/ignite/client/fakes/FakeInternalTable.java
Show resolved
Hide resolved
...-engine/src/integrationTest/java/org/apache/ignite/internal/sql/sqllogic/ItSqlLogicTest.java
Show resolved
Hide resolved
...n/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java
Show resolved
Hide resolved
@@ -534,7 +540,7 @@ private CompletableFuture<?> processRequest(ReplicaRequest request, @Nullable Bo | |||
// Don't need to validate schema. | |||
if (opTs == null) { | |||
assert opTsIfDirectRo == null; | |||
return processOperationRequestWithTxRwCounter(senderId, request, isPrimary, null, leaseStartTime); | |||
return processOperationRequestWithWrappingLogic(senderId, request, isPrimary, null, leaseStartTime); |
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 don't like the postfix "WithWrappingLogic", wrapping is very general term and thus such postfix says nothing.
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 method now adds wrapping related to:
- RW operation counting
- RO operation LWM locking/unlocking
The old name only mentioned 1 and now became 'not completely true'. Adding another suffix to mention RO+LWM to the existing one would produce a monstrosity. That's why I chose a generic name that says that it adds some wrapping.
Do you have a specific idea on how to improve this?
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 you have a specific idea on how to improve this?
Nothing good, e.g. processOperationRequestWithTxResourceManagementWrappingLogic. Up to you.
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.
Renamed to processOperationRequestWithTxOperationManagementLogic()
(one word shorter than you suggested as it was too ugly wrt line breaks)
...n/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java
Show resolved
Hide resolved
...n/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java
Show resolved
Hide resolved
...n/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java
Show resolved
Hide resolved
...grationTest/java/org/apache/ignite/internal/tx/readonly/ItReadOnlyTxAndLowWatermarkTest.java
Show resolved
Hide resolved
...grationTest/java/org/apache/ignite/internal/tx/readonly/ItReadOnlyTxAndLowWatermarkTest.java
Show resolved
Hide resolved
...les/transactions/src/main/java/org/apache/ignite/internal/tx/impl/ResourceVacuumManager.java
Outdated
Show resolved
Hide resolved
@Nullable | ||
UUID transactionId(); | ||
|
||
/** Inconsistent ID of transaction to which this operation belongs. */ |
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.
Inconsistent ID of transaction coordinator I guess.
https://issues.apache.org/jira/browse/IGNITE-23748