Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.google.common.annotations.VisibleForTesting;
import io.airlift.configuration.Config;
import io.airlift.configuration.ConfigDescription;
import io.airlift.configuration.DefunctConfig;
import io.airlift.configuration.LegacyConfig;
import io.airlift.units.DataSize;
import io.airlift.units.Duration;
Expand All @@ -36,6 +37,7 @@
import static java.util.concurrent.TimeUnit.DAYS;
import static java.util.concurrent.TimeUnit.SECONDS;

@DefunctConfig("delta.experimental.ignore-checkpoint-write-failures")
public class DeltaLakeConfig
{
public static final String VACUUM_MIN_RETENTION = "delta.vacuum.min-retention";
Expand All @@ -59,7 +61,6 @@ public class DeltaLakeConfig
private boolean unsafeWritesEnabled;
private boolean checkpointRowStatisticsWritingEnabled = true;
private long defaultCheckpointWritingInterval = 10;
private boolean ignoreCheckpointWriteFailures;
private Duration vacuumMinRetention = new Duration(7, DAYS);
private Optional<String> hiveCatalogName = Optional.empty();
private Duration dynamicFilteringWaitTimeout = new Duration(0, SECONDS);
Expand Down Expand Up @@ -249,18 +250,6 @@ public long getDefaultCheckpointWritingInterval()
return defaultCheckpointWritingInterval;
}

@Config("delta.experimental.ignore-checkpoint-write-failures")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a @DefunctConfig annotation

public DeltaLakeConfig setIgnoreCheckpointWriteFailures(boolean ignoreCheckpointWriteFailures)
{
this.ignoreCheckpointWriteFailures = ignoreCheckpointWriteFailures;
return this;
}

public boolean isIgnoreCheckpointWriteFailures()
{
return ignoreCheckpointWriteFailures;
}

@NotNull
public Duration getVacuumMinRetention()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ public class DeltaLakeMetadata
private final TypeManager typeManager;
private final CheckpointWriterManager checkpointWriterManager;
private final long defaultCheckpointInterval;
private final boolean ignoreCheckpointWriteFailures;
private final int domainCompactionThreshold;
private final boolean unsafeWritesEnabled;
private final JsonCodec<DataFileInfo> dataFileInfoCodec;
Expand Down Expand Up @@ -300,7 +299,6 @@ public DeltaLakeMetadata(
NodeManager nodeManager,
CheckpointWriterManager checkpointWriterManager,
long defaultCheckpointInterval,
boolean ignoreCheckpointWriteFailures,
boolean deleteSchemaLocationsFallback,
DeltaLakeRedirectionsProvider deltaLakeRedirectionsProvider,
ExtendedStatisticsAccess statisticsAccess,
Expand All @@ -321,7 +319,6 @@ public DeltaLakeMetadata(
this.nodeId = nodeManager.getCurrentNode().getNodeIdentifier();
this.checkpointWriterManager = requireNonNull(checkpointWriterManager, "checkpointWriterManager is null");
this.defaultCheckpointInterval = defaultCheckpointInterval;
this.ignoreCheckpointWriteFailures = ignoreCheckpointWriteFailures;
this.deltaLakeRedirectionsProvider = requireNonNull(deltaLakeRedirectionsProvider, "deltaLakeRedirectionsProvider is null");
this.statisticsAccess = requireNonNull(statisticsAccess, "statisticsAccess is null");
this.deleteSchemaLocationsFallback = deleteSchemaLocationsFallback;
Expand Down Expand Up @@ -1935,12 +1932,9 @@ private void writeCheckpointIfNeeded(ConnectorSession session, SchemaTableName t
checkpointWriterManager.writeCheckpoint(session, snapshot);
}
catch (Exception e) {
if (ignoreCheckpointWriteFailures) {
LOG.warn(e, "Failed to write checkpoint for table %s for version %s", table, newVersion);
}
else {
throw new TrinoException(GENERIC_INTERNAL_ERROR, format("Failed to write checkpoint for table %s for version %s", table, newVersion), e);
}
// We can't fail here as transaction was already committed, in case of INSERT this could result
// in inserting data twice if client saw an error and decided to retry
LOG.error(e, "Failed to write checkpoint for table %s for version %s", table, newVersion);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's capture the reasoning from our conversation, why we don't fail here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment added

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public class DeltaLakeMetadataFactory
private final int domainCompactionThreshold;
private final boolean unsafeWritesEnabled;
private final long checkpointWritingInterval;
private final boolean ignoreCheckpointWriteFailures;
private final long perTransactionMetastoreCacheMaximumSize;
private final boolean deleteSchemaLocationsFallback;
private final boolean useUniqueTableLocation;
Expand Down Expand Up @@ -94,7 +93,6 @@ public DeltaLakeMetadataFactory(
this.domainCompactionThreshold = deltaLakeConfig.getDomainCompactionThreshold();
this.unsafeWritesEnabled = deltaLakeConfig.getUnsafeWritesEnabled();
this.checkpointWritingInterval = deltaLakeConfig.getDefaultCheckpointWritingInterval();
this.ignoreCheckpointWriteFailures = deltaLakeConfig.isIgnoreCheckpointWriteFailures();
this.perTransactionMetastoreCacheMaximumSize = deltaLakeConfig.getPerTransactionMetastoreCacheMaximumSize();
this.deleteSchemaLocationsFallback = deltaLakeConfig.isDeleteSchemaLocationsFallback();
this.useUniqueTableLocation = deltaLakeConfig.isUniqueTableLocation();
Expand Down Expand Up @@ -128,7 +126,6 @@ public DeltaLakeMetadata create(ConnectorIdentity identity)
nodeManager,
checkpointWriterManager,
checkpointWritingInterval,
ignoreCheckpointWriteFailures,
deleteSchemaLocationsFallback,
deltaLakeRedirectionsProvider,
statisticsAccess,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public void testDefaults()
.setMaxPartitionsPerWriter(100)
.setUnsafeWritesEnabled(false)
.setDefaultCheckpointWritingInterval(10)
.setIgnoreCheckpointWriteFailures(false)
.setCheckpointRowStatisticsWritingEnabled(true)
.setVacuumMinRetention(new Duration(7, DAYS))
.setHiveCatalogName(null)
Expand Down Expand Up @@ -84,7 +83,6 @@ public void testExplicitPropertyMappings()
.put("delta.max-partitions-per-writer", "200")
.put("delta.enable-non-concurrent-writes", "true")
.put("delta.default-checkpoint-writing-interval", "15")
.put("delta.experimental.ignore-checkpoint-write-failures", "true")
.put("delta.checkpoint-row-statistics-writing.enabled", "false")
.put("delta.vacuum.min-retention", "13h")
.put("delta.hive-catalog-name", "hive")
Expand Down Expand Up @@ -113,7 +111,6 @@ public void testExplicitPropertyMappings()
.setMaxPartitionsPerWriter(200)
.setUnsafeWritesEnabled(true)
.setDefaultCheckpointWritingInterval(15)
.setIgnoreCheckpointWriteFailures(true)
.setCheckpointRowStatisticsWritingEnabled(false)
.setVacuumMinRetention(new Duration(13, HOURS))
.setHiveCatalogName("hive")
Expand Down