You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "anton-vinogradov (via GitHub)" <gi...@apache.org> on 2023/10/05 17:05:02 UTC

[PR] IGNITE-20579 Finally restrict atomic operations inside the transaction (remove the system property) [ignite]

anton-vinogradov opened a new pull request, #10979:
URL: https://github.com/apache/ignite/pull/10979

   Thank you for submitting the pull request to the Apache Ignite.
   
   In order to streamline the review of the contribution 
   we ask you to ensure the following steps have been taken:
   
   ### The Contribution Checklist
   - [ ] There is a single JIRA ticket related to the pull request. 
   - [ ] The web-link to the pull request is attached to the JIRA ticket.
   - [ ] The JIRA ticket has the _Patch Available_ state.
   - [ ] The pull request body describes changes that have been made. 
   The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
   - [ ] The pull request title is treated as the final commit message. 
   The following pattern must be used: `IGNITE-XXXX Change summary` where `XXXX` - number of JIRA issue.
   - [ ] A reviewer has been mentioned through the JIRA comments 
   (see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers)) 
   - [ ] The pull request has been checked by the Teamcity Bot and 
   the `green visa` attached to the JIRA ticket (see [TC.Bot: Check PR](https://mtcga.gridgain.com/prs.html))
   
   ### Notes
   - [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
   - [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
   - [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
   - [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
   
   If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
   


-- 
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-20579 Finally restrict atomic operations inside the transaction (remove the system property) [ignite]

Posted by "anton-vinogradov (via GitHub)" <gi...@apache.org>.
anton-vinogradov merged PR #10979:
URL: https://github.com/apache/ignite/pull/10979


-- 
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-20579 Finally restrict atomic operations inside the transaction (remove the system property) [ignite]

Posted by "anton-vinogradov (via GitHub)" <gi...@apache.org>.
anton-vinogradov commented on code in PR #10979:
URL: https://github.com/apache/ignite/pull/10979#discussion_r1360905155


##########
modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java:
##########
@@ -144,7 +144,7 @@ public void testDefaultTimeToLiveLoadCache() throws Exception {
 
         checkSizeBeforeLive(SIZE);
 
-        Thread.sleep(DEFAULT_TIME_TO_LIVE + 500);
+        Thread.sleep(DEFAULT_TIME_TO_LIVE + 1000);

Review Comment:
   These tests are flacky by their nature.
   `checkSizeBeforeLive` become slightly faster (~20 ms because of removed check) and tests become more flacky.
   So, added the cheapes fix (+500ms).



-- 
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-20579 Finally restrict atomic operations inside the transaction (remove the system property) [ignite]

Posted by "alex-plekhanov (via GitHub)" <gi...@apache.org>.
alex-plekhanov commented on code in PR #10979:
URL: https://github.com/apache/ignite/pull/10979#discussion_r1357302603


##########
modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java:
##########
@@ -144,7 +144,7 @@ public void testDefaultTimeToLiveLoadCache() throws Exception {
 
         checkSizeBeforeLive(SIZE);
 
-        Thread.sleep(DEFAULT_TIME_TO_LIVE + 500);
+        Thread.sleep(DEFAULT_TIME_TO_LIVE + 1000);

Review Comment:
   How it's related to patch?
   Can we introduce some static final field instead of hardcoded value?



##########
modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheImpl.cs:
##########
@@ -252,19 +252,6 @@ public bool IsEmpty()
                 flagPartitionRecover: _flagPartitionRecover);
         }
 
-        /** <inheritDoc /> */
-        public ICache<TK, TV> WithAllowAtomicOpsInTx()
-        {
-            var target = DoOutOpObject((int)CacheOp.WithSkipStore);

Review Comment:
   Looks like it's never worked for .NET (WithSkipStore instead of WithAllowAtomicOpsInTx)



##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/AtomicOperationsInTxTest.java:
##########
@@ -69,144 +65,84 @@ public class AtomicOperationsInTxTest extends GridCommonAbstractTest {
     }
 
     /**
-     * Tests whether enabling atomic cache operations within transactions is allowed.
+     * Tests that atomic cache operations are not allowed within transactions.
      */
     @Test
-    @WithSystemProperty(key = IGNITE_ALLOW_ATOMIC_OPS_IN_TX, value = "false")
-    public void testEnablingAtomicOperationDuringTransaction() {
-        GridTestUtils.assertThrows(log, (Callable<IgniteCache>)() -> {
-            try (Transaction tx = grid(0).transactions().txStart()) {
-                return grid(0).cache(DEFAULT_CACHE_NAME).withAllowAtomicOpsInTx();
-            }
-        },
-            IllegalStateException.class,
-            "Enabling atomic operations during active transaction is not allowed. Enable atomic operations before " +
-                    "transaction start."
-        );
-    }
-
-    /**
-     * Tests whether allowing atomic cache operations before transaction starts does not cause exceptions.
-     */
-    @Test
-    @WithSystemProperty(key = IGNITE_ALLOW_ATOMIC_OPS_IN_TX, value = "true")
-    public void testAllowAtomicOperationsBeforeTransactionStarts() {
-        try (Transaction tx = grid(0).transactions().txStart()) {
-            grid(0).cache(DEFAULT_CACHE_NAME).withAllowAtomicOpsInTx();
-        }
-    }
-
-    /**
-     * Tests that atomic cache operations within transactions are allowed if the system property
-     * {@link IgniteSystemProperties#IGNITE_ALLOW_ATOMIC_OPS_IN_TX IGNITE_ALLOW_ATOMIC_OPS_IN_TX} is not changed from
-     * the default {@code false} and the user explicitly allows atomic operations in
-     * transactions via {@link IgniteCache#withAllowAtomicOpsInTx() withAllowAtomicOpsInTx()} before transactions start.
-     */
-    @Test
-    @WithSystemProperty(key = IGNITE_ALLOW_ATOMIC_OPS_IN_TX, value = "false")
     public void testSetOfAtomicOperationsWithinTransactionsCheckFalseSystemPropertyFalse() {

Review Comment:
   Can we rename method?



-- 
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-20579 Finally restrict atomic operations inside the transaction (remove the system property) [ignite]

Posted by "anton-vinogradov (via GitHub)" <gi...@apache.org>.
anton-vinogradov commented on code in PR #10979:
URL: https://github.com/apache/ignite/pull/10979#discussion_r1360901253


##########
modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheImpl.cs:
##########
@@ -252,19 +252,6 @@ public bool IsEmpty()
                 flagPartitionRecover: _flagPartitionRecover);
         }
 
-        /** <inheritDoc /> */
-        public ICache<TK, TV> WithAllowAtomicOpsInTx()
-        {
-            var target = DoOutOpObject((int)CacheOp.WithSkipStore);

Review Comment:
   Looks so



##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/AtomicOperationsInTxTest.java:
##########
@@ -69,144 +65,84 @@ public class AtomicOperationsInTxTest extends GridCommonAbstractTest {
     }
 
     /**
-     * Tests whether enabling atomic cache operations within transactions is allowed.
+     * Tests that atomic cache operations are not allowed within transactions.
      */
     @Test
-    @WithSystemProperty(key = IGNITE_ALLOW_ATOMIC_OPS_IN_TX, value = "false")
-    public void testEnablingAtomicOperationDuringTransaction() {
-        GridTestUtils.assertThrows(log, (Callable<IgniteCache>)() -> {
-            try (Transaction tx = grid(0).transactions().txStart()) {
-                return grid(0).cache(DEFAULT_CACHE_NAME).withAllowAtomicOpsInTx();
-            }
-        },
-            IllegalStateException.class,
-            "Enabling atomic operations during active transaction is not allowed. Enable atomic operations before " +
-                    "transaction start."
-        );
-    }
-
-    /**
-     * Tests whether allowing atomic cache operations before transaction starts does not cause exceptions.
-     */
-    @Test
-    @WithSystemProperty(key = IGNITE_ALLOW_ATOMIC_OPS_IN_TX, value = "true")
-    public void testAllowAtomicOperationsBeforeTransactionStarts() {
-        try (Transaction tx = grid(0).transactions().txStart()) {
-            grid(0).cache(DEFAULT_CACHE_NAME).withAllowAtomicOpsInTx();
-        }
-    }
-
-    /**
-     * Tests that atomic cache operations within transactions are allowed if the system property
-     * {@link IgniteSystemProperties#IGNITE_ALLOW_ATOMIC_OPS_IN_TX IGNITE_ALLOW_ATOMIC_OPS_IN_TX} is not changed from
-     * the default {@code false} and the user explicitly allows atomic operations in
-     * transactions via {@link IgniteCache#withAllowAtomicOpsInTx() withAllowAtomicOpsInTx()} before transactions start.
-     */
-    @Test
-    @WithSystemProperty(key = IGNITE_ALLOW_ATOMIC_OPS_IN_TX, value = "false")
     public void testSetOfAtomicOperationsWithinTransactionsCheckFalseSystemPropertyFalse() {

Review Comment:
   Done



-- 
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