diff --git a/modules/client-common/src/main/java/org/apache/ignite/internal/jdbc/proto/event/JdbcObservableTimeAwareRequest.java b/modules/client-common/src/main/java/org/apache/ignite/internal/jdbc/proto/event/JdbcObservableTimeAwareRequest.java index ef08443baf0..23ec5f3e20f 100644 --- a/modules/client-common/src/main/java/org/apache/ignite/internal/jdbc/proto/event/JdbcObservableTimeAwareRequest.java +++ b/modules/client-common/src/main/java/org/apache/ignite/internal/jdbc/proto/event/JdbcObservableTimeAwareRequest.java @@ -23,11 +23,11 @@ * An extension to JDBC request that provides the ability to update and read client observable time. */ abstract class JdbcObservableTimeAwareRequest { - /** Holds the latest time observed by client. */ + /** Tracker of the latest time observed by client. */ @SuppressWarnings("TransientFieldInNonSerializableClass") private final transient HybridTimestampTracker timestampTracker = HybridTimestampTracker.atomicTracker(null); - /** Returns the holder with the latest time observed by client. */ + /** Returns the tracker of the latest time observed by client. */ public HybridTimestampTracker timestampTracker() { return timestampTracker; } diff --git a/modules/client-handler/src/main/java/org/apache/ignite/client/handler/ClientInboundMessageHandler.java b/modules/client-handler/src/main/java/org/apache/ignite/client/handler/ClientInboundMessageHandler.java index fb7b6eeef45..889833c8998 100644 --- a/modules/client-handler/src/main/java/org/apache/ignite/client/handler/ClientInboundMessageHandler.java +++ b/modules/client-handler/src/main/java/org/apache/ignite/client/handler/ClientInboundMessageHandler.java @@ -817,6 +817,7 @@ private void processOperation(ChannelHandlerContext ctx, ClientMessageUnpacker i case ClientOp.SQL_EXEC_SCRIPT: return ClientSqlExecuteScriptRequest.process(in, queryProcessor).thenRun(() -> { if (out.meta() == null) { + // TODO https://issues.apache.org/jira/browse/IGNITE-24275 Must set updated time instead of current time. out.meta(clockService.current()); } }); diff --git a/modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/jdbc/ClientJdbcFinishTxRequest.java b/modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/jdbc/ClientJdbcFinishTxRequest.java index 7aeb903b3c0..b04586c091c 100644 --- a/modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/jdbc/ClientJdbcFinishTxRequest.java +++ b/modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/jdbc/ClientJdbcFinishTxRequest.java @@ -43,9 +43,7 @@ public static CompletableFuture process( boolean commit = in.unpackBoolean(); return handler.finishTxAsync(connectionId, commit).thenAccept(res -> { - if (commit) { - out.meta(res.observableTime()); - } + out.meta(res.observableTime()); res.writeBinary(out); }); diff --git a/modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/sql/ClientSqlExecuteScriptRequest.java b/modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/sql/ClientSqlExecuteScriptRequest.java index 4652e8a4598..a242591f047 100644 --- a/modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/sql/ClientSqlExecuteScriptRequest.java +++ b/modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/sql/ClientSqlExecuteScriptRequest.java @@ -49,6 +49,7 @@ public static CompletableFuture process( arguments = ArrayUtils.OBJECT_EMPTY_ARRAY; } + // TODO https://issues.apache.org/jira/browse/IGNITE-24275 Script must return updated time to client. HybridTimestamp clientTs = HybridTimestamp.nullableHybridTimestamp(in.unpackLong()); var tsUpdater = HybridTimestampTracker.clientTracker(clientTs, ts -> {}); diff --git a/modules/transactions/src/main/java/org/apache/ignite/internal/tx/InternalTransaction.java b/modules/transactions/src/main/java/org/apache/ignite/internal/tx/InternalTransaction.java index 75a2b42ad42..ed50e6527c5 100644 --- a/modules/transactions/src/main/java/org/apache/ignite/internal/tx/InternalTransaction.java +++ b/modules/transactions/src/main/java/org/apache/ignite/internal/tx/InternalTransaction.java @@ -92,9 +92,9 @@ public interface InternalTransaction extends Transaction { HybridTimestamp startTimestamp(); /** - * Returns observable timestamp. + * Returns an observable timestamp provided by the observable timestamp tracker. * - * @return observable timestamp. + * @return observable timestamp, or {@code null} if the observable time has not yet been initialized/updated. */ @Nullable HybridTimestamp observableTimestamp();