You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "nevdmitry (via GitHub)" <gi...@apache.org> on 2025/02/20 21:03:45 UTC
[PR] IGNITE-24296 Implement cancel transaction REST endpoint [ignite-3]
nevdmitry opened a new pull request, #5259:
URL: https://github.com/apache/ignite-3/pull/5259
https://issues.apache.org/jira/browse/IGNITE-24296
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-24296 Implement cancel transaction REST endpoint [ignite-3]
Posted by "myskov (via GitHub)" <gi...@apache.org>.
myskov commented on code in PR #5259:
URL: https://github.com/apache/ignite-3/pull/5259#discussion_r1964960152
##########
modules/rest/src/integrationTest/java/org/apache/ignite/internal/rest/transaction/ItTransactionControllerTest.java:
##########
@@ -142,6 +140,34 @@ void shouldReturnProblemIfCancelNonExistingTransaction() {
);
}
+ @Test
+ void shouldCancelTransaction() {
+ Transaction roTx = node(0).transactions().begin(new TransactionOptions().readOnly(true));
+ Transaction rwTx = node(0).transactions().begin(new TransactionOptions().readOnly(false));
+
+ TransactionInfo roTransactionInfo = getTransaction(client, ((InternalTransaction) roTx).id());
+ assertThat(roTransactionInfo, notNullValue());
+
+ cancelTransaction(client, roTransactionInfo.id());
+
+ assertThrowsProblem(
+ () -> getTransaction(client, roTransactionInfo.id()),
+ NOT_FOUND,
+ isProblem().withDetail("Transaction not found [transactionId=" + roTransactionInfo.id() + "]")
+ );
+
+ TransactionInfo rwTransactionInfo = getTransaction(client, ((InternalTransaction) rwTx).id());
Review Comment:
looks like it's the same code written twice, with two assertions and 2 arguments. Shouldn't it be parametrized test? or two tests with some shared method?
##########
modules/rest/src/main/java/org/apache/ignite/internal/rest/transaction/TransactionController.java:
##########
@@ -78,7 +78,6 @@ public CompletableFuture<TransactionInfo> transaction(UUID transactionId) {
@Override
public CompletableFuture<Void> cancelTransaction(UUID transactionId) {
Review Comment:
There's KILL query in SQL and InternalTransaction.kill() to abort transaction. Shouldn't we use term "kill" instead of "cancel" then?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-24296 Implement cancel transaction REST endpoint [ignite-3]
Posted by "valepakh (via GitHub)" <gi...@apache.org>.
valepakh commented on code in PR #5259:
URL: https://github.com/apache/ignite-3/pull/5259#discussion_r1965169696
##########
modules/rest/src/integrationTest/java/org/apache/ignite/internal/rest/transaction/ItTransactionControllerTest.java:
##########
@@ -142,6 +140,34 @@ void shouldReturnProblemIfCancelNonExistingTransaction() {
);
}
+ @Test
+ void shouldCancelTransaction() {
+ Transaction roTx = node(0).transactions().begin(new TransactionOptions().readOnly(true));
+ Transaction rwTx = node(0).transactions().begin(new TransactionOptions().readOnly(false));
+
+ TransactionInfo roTransactionInfo = getTransaction(client, ((InternalTransaction) roTx).id());
+ assertThat(roTransactionInfo, notNullValue());
+
+ cancelTransaction(client, roTransactionInfo.id());
+
+ assertThrowsProblem(
+ () -> getTransaction(client, roTransactionInfo.id()),
+ NOT_FOUND,
+ isProblem().withDetail("Transaction not found [transactionId=" + roTransactionInfo.id() + "]")
+ );
+
+ TransactionInfo rwTransactionInfo = getTransaction(client, ((InternalTransaction) rwTx).id());
Review Comment:
+1 to
```
@ParameterizedTest
@ValueSource(booleans = {true, false})
void shouldCancelTransaction(boolean readOnly) {
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-24296 Implement cancel transaction REST endpoint [ignite-3]
Posted by "nevdmitry (via GitHub)" <gi...@apache.org>.
nevdmitry commented on code in PR #5259:
URL: https://github.com/apache/ignite-3/pull/5259#discussion_r1965654787
##########
modules/rest/src/main/java/org/apache/ignite/internal/rest/transaction/TransactionController.java:
##########
@@ -78,7 +78,6 @@ public CompletableFuture<TransactionInfo> transaction(UUID transactionId) {
@Override
public CompletableFuture<Void> cancelTransaction(UUID transactionId) {
Review Comment:
renamed in rest controllers but sql module have the same mix of kill and cancel terminology, leave sql code as is
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-24296 Implement cancel transaction REST endpoint [ignite-3]
Posted by "PakhomovAlexander (via GitHub)" <gi...@apache.org>.
PakhomovAlexander commented on code in PR #5259:
URL: https://github.com/apache/ignite-3/pull/5259#discussion_r1965107391
##########
modules/rest/src/main/java/org/apache/ignite/internal/rest/transaction/TransactionController.java:
##########
@@ -78,7 +78,6 @@ public CompletableFuture<TransactionInfo> transaction(UUID transactionId) {
@Override
public CompletableFuture<Void> cancelTransaction(UUID transactionId) {
Review Comment:
+1. If we call this method like "kill" in Transaction API, then REST API should have same naming.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-24296 Implement cancel transaction REST endpoint [ignite-3]
Posted by "PakhomovAlexander (via GitHub)" <gi...@apache.org>.
PakhomovAlexander merged PR #5259:
URL: https://github.com/apache/ignite-3/pull/5259
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-24296 Implement cancel transaction REST endpoint [ignite-3]
Posted by "PakhomovAlexander (via GitHub)" <gi...@apache.org>.
PakhomovAlexander commented on code in PR #5259:
URL: https://github.com/apache/ignite-3/pull/5259#discussion_r1965105304
##########
modules/rest/src/integrationTest/java/org/apache/ignite/internal/rest/transaction/ItTransactionControllerTest.java:
##########
@@ -142,6 +140,34 @@ void shouldReturnProblemIfCancelNonExistingTransaction() {
);
}
+ @Test
+ void shouldCancelTransaction() {
+ Transaction roTx = node(0).transactions().begin(new TransactionOptions().readOnly(true));
+ Transaction rwTx = node(0).transactions().begin(new TransactionOptions().readOnly(false));
+
+ TransactionInfo roTransactionInfo = getTransaction(client, ((InternalTransaction) roTx).id());
+ assertThat(roTransactionInfo, notNullValue());
+
+ cancelTransaction(client, roTransactionInfo.id());
+
+ assertThrowsProblem(
+ () -> getTransaction(client, roTransactionInfo.id()),
+ NOT_FOUND,
+ isProblem().withDetail("Transaction not found [transactionId=" + roTransactionInfo.id() + "]")
+ );
+
+ TransactionInfo rwTransactionInfo = getTransaction(client, ((InternalTransaction) rwTx).id());
Review Comment:
Frankly speaking I don see any problem in such testing code.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org