Lalant commented on code in PR #7482:
URL: https://github.com/apache/ignite-3/pull/7482#discussion_r2917618095
##########
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) {
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]