denis-chudov commented on code in PR #7349:
URL: https://github.com/apache/ignite-3/pull/7349#discussion_r2811944800


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/storage/InternalTableImpl.java:
##########
@@ -1760,6 +1775,11 @@ private Publisher<BinaryRow> readWriteScan(
     ) {
         assert !opCtx.txContext().isReadOnly();
 
+        TxContext.ReadWrite txContext = (TxContext.ReadWrite) 
opCtx.txContext();
+
+        // Update transaction state meta with label if present

Review Comment:
   ```suggestion
           // Update transaction state meta with label if present.
   ```



##########
modules/api/src/main/java/org/apache/ignite/tx/TransactionOptions.java:
##########
@@ -80,4 +86,30 @@ public TransactionOptions readOnly(boolean readOnly) {
 
         return this;
     }
+
+    /**
+     * Returns transaction label. The label is used for identification in logs 
and system views.
+     *
+     * @return Transaction label, or {@code null} if not set.
+     */
+    @Nullable
+    public String label() {
+        return label;
+    }
+
+    /**
+     * Sets the transaction label. The label is included in diagnostic and 
observability outputs,
+     * such as logs and system views.

Review Comment:
   ```suggestion
        * such as logs, system views, etc.
   ```
   Please add the same in getter.



##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/TxManagerImpl.java:
##########
@@ -454,6 +454,10 @@ public InternalTransaction 
beginImplicit(HybridTimestampTracker timestampTracker
 
     @Override
     public InternalTransaction beginExplicit(HybridTimestampTracker 
timestampTracker, boolean readOnly, InternalTxOptions txOptions) {
+        if (readOnly && txOptions.txLabel() != null) {
+            throw new TransactionException(Common.ILLEGAL_ARGUMENT_ERR, 
"labels are not supported for read only transactions");

Review Comment:
   ```suggestion
               throw new TransactionException(Common.ILLEGAL_ARGUMENT_ERR, 
"Labels are not supported for read only transactions");
   ```



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