You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "korlov42 (via GitHub)" <gi...@apache.org> on 2025/01/17 07:24:32 UTC
Re: [PR] IGNITE-24055 Sql. Update the observation timestamp only after processing DDL statements [ignite-3]
korlov42 commented on code in PR #5032:
URL: https://github.com/apache/ignite-3/pull/5032#discussion_r1919666317
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ddl/DdlCommandHandler.java:
##########
@@ -88,8 +88,15 @@ public DdlCommandHandler(
this.partitionIdleSafeTimePropagationPeriodMsSupplier = partitionIdleSafeTimePropagationPeriodMsSupplier;
}
- /** Handles ddl commands. */
- public CompletableFuture<Boolean> handle(CatalogCommand cmd) {
+ /**
+ * Handles ddl commands.
+ *
+ * @param cmd Catalog command.
+ * @return Future representing pending completion of the operation. If the command execution resulted in a modification of the catalog,
+ * the result will be the activation timestamp of the new catalog version, if the command did not result in a change of the
+ * catalog, the result will be {@code null}.
+ */
+ public CompletableFuture<Long> handle(CatalogCommand cmd) {
Review Comment:
```suggestion
public CompletableFuture<@Nullable Long> handle(CatalogCommand cmd) {
```
perhaps, it worth to add the annotation to every return type
##########
modules/catalog/src/main/java/org/apache/ignite/internal/catalog/commands/CatalogUtils.java:
##########
@@ -542,11 +542,7 @@ public static HybridTimestamp clusterWideEnsuredActivationTsSafeForRoReads(
LongSupplier partitionIdleSafeTimePropagationPeriodMsSupplier,
long maxClockSkewMillis
) {
- HybridTimestamp clusterWideEnsuredActivationTs = clusterWideEnsuredActivationTimestamp(catalog.time(), maxClockSkewMillis);
Review Comment:
I think, we can remove `clusterWideEnsuredActivationTsSafeForRoReads`. It accepts `partitionIdleSafeTimePropagationPeriodMsSupplier`, but this parameter is not used anymore. Also, `partitionIdleSafeTimePropagationPeriodMsSupplier` can be removed as well from `CatalogManagerImpl` and `DdlCommandHandler`
##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/framework/ImplicitTxContext.java:
##########
@@ -26,10 +26,12 @@
/** Context that always creates implicit transaction. */
public class ImplicitTxContext implements QueryTransactionContext {
- public static final QueryTransactionContext INSTANCE = new ImplicitTxContext();
-
private final HybridTimestampTracker observableTimeTracker = HybridTimestampTracker.atomicTracker(null);
+ public static ImplicitTxContext instance() {
Review Comment:
I think, the name `create` will better reflect semantic
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org