Lalant commented on code in PR #7482:
URL: https://github.com/apache/ignite-3/pull/7482#discussion_r2917949838


##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/VolatileTxStateMetaStorage.java:
##########
@@ -115,6 +119,53 @@ public void initialize(InternalTransaction tx, @Nullable 
String txLabel) {
         });
     }
 
+    /**
+     * Atomically updates transaction metadata (TxStateMeta) without 
validating TxState transitions.
+     * Use this only for metadata-only changes that do not affect 
state-derived fields
+     * (currently exception info or labels), and never to update TxState 
itself.
+     *
+     * @param txId Transaction id.
+     * @param updater Transaction meta updater.
+     * @return Updated transaction state.
+     */
+    public @Nullable <T extends TxStateMeta> T enrichMeta(UUID txId,
+            Function<@Nullable TxStateMeta, TxStateMeta> updater) {
+        return (T) txStateMap.compute(txId, (k, oldMeta) -> {
+            TxStateMeta newMeta = updater.apply(oldMeta);
+
+            if (newMeta == null) {
+                if (oldMeta != null) {
+                    LOG.info("Skipped removing transaction state in enrichMeta 
[txId={}].", txId);

Review Comment:
   Done.



##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/VolatileTxStateMetaStorage.java:
##########
@@ -46,6 +48,8 @@
  * The class represents volatile transaction state storage that stores a 
transaction state meta until the node stops.
  */
 public class VolatileTxStateMetaStorage {
+    private static final IgniteLogger LOG = 
Loggers.forClass(VolatileTxStateMetaStorage.class);

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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to