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


##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/IgniteTransactionsImpl.java:
##########
@@ -39,25 +41,31 @@ public IgniteTransactionsImpl(TxManager txManager) {
         this.txManager = txManager;
     }
 
-    /** {@inheritDoc} */
-    @Override
-    public Transaction begin(@Nullable TransactionOptions options) {
+    /**
+     * Begins a transaction.
+     *
+     * @param options Transaction options.
+     * @param observableTimestamp Timestamp.

Review Comment:
   Let's minimize the usage of such placeholder descriptions :) you can easily 
reuse the description of observable timestamp from javadoc from here: 
`TxManager#begin(boolean, org.apache.ignite.internal.hlc.HybridTimestamp)`



##########
modules/client/src/test/java/org/apache/ignite/client/ObservableTimestampPropagationTest.java:
##########
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.client;
+
+import static 
org.apache.ignite.internal.hlc.HybridTimestamp.LOGICAL_TIME_BITS_SIZE;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicLong;
+import org.apache.ignite.client.fakes.FakeIgnite;
+import org.apache.ignite.internal.TestHybridClock;
+import org.apache.ignite.internal.hlc.HybridTimestamp;
+import org.apache.ignite.internal.util.IgniteUtils;
+import org.apache.ignite.tx.TransactionOptions;
+import org.jetbrains.annotations.Nullable;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Tests that observable timestamp (causality token) is propagated from server 
to client and back.
+ */
+public class ObservableTimestampPropagationTest {
+    private static TestServer testServer;
+
+    private static FakeIgnite ignite;
+
+    private static IgniteClient client;
+
+    private static final AtomicLong observableTimestamp = new AtomicLong(1);

Review Comment:
   I suggest to rename it to `currentServerTimestamp`, because it actually is 
it. Observable timestamp is something that is transmitted from client to the 
server.



##########
modules/client-handler/src/main/java/org/apache/ignite/client/handler/ClientInboundMessageHandler.java:
##########
@@ -385,6 +394,7 @@ private void writeError(long requestId, int opCode, 
Throwable err, ChannelHandle
             packer.packInt(ServerMessageType.RESPONSE);
             packer.packLong(requestId);
             writeFlags(packer, ctx);
+            packer.packLong(observableTimestamp(null));

Review Comment:
   Does it make sense? It will just write the current timestamp, unrelated to 
the error itself



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