Skip to content

Commit

Permalink
Enable failure recovery for Delta connector
Browse files Browse the repository at this point in the history
  • Loading branch information
losipiuk committed Mar 29, 2022
1 parent f8eda0c commit b43e7c1
Show file tree
Hide file tree
Showing 13 changed files with 607 additions and 37 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ jobs:
- { modules: plugin/trino-cassandra }
- { modules: plugin/trino-clickhouse }
- { modules: plugin/trino-delta-lake }
- { modules: plugin/trino-delta-lake, profile: test-failure-recovery }
- { modules: plugin/trino-hive }
- { modules: plugin/trino-hive, profile: test-parquet }
- { modules: plugin/trino-hive, profile: test-failure-recovery }
Expand Down
63 changes: 63 additions & 0 deletions plugin/trino-delta-lake/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,18 @@
</dependency>

<!-- for testing -->
<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-exchange</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-exchange</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.trino</groupId>
Expand Down Expand Up @@ -243,6 +255,12 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-testing-containers</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-testing-services</artifactId>
Expand Down Expand Up @@ -289,6 +307,18 @@
<artifactId>azure-storage-blob</artifactId>
<version>12.10.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
<!-- conflicts with newer version of netty coming from AWS S3 cli via trino-exchange -->
<groupId>io.netty</groupId>
<artifactId>netty-transport-classes-epoll</artifactId>
</exclusion>
<exclusion>
<!-- conflicts with newer version of netty coming from AWS S3 cli via trino-exchange -->
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down Expand Up @@ -380,9 +410,22 @@
<exclude>**/TestDeltaLakeAdlsStorage.java</exclude>
<exclude>**/TestDeltaLakeAdlsConnectorSmokeTest.java</exclude>
<exclude>**/TestDeltaLakeGlueMetastore.java</exclude>
<exclude>**/TestDelta*FailureRecoveryTest.java</exclude>
</excludes>
</configuration>
</plugin>

<plugin>
<groupId>org.basepom.maven</groupId>
<artifactId>duplicate-finder-maven-plugin</artifactId>
<configuration>
<ignoredResourcePatterns>
<!-- com.amazonaws:aws-java-sdk-core and software.amazon.awssdk:sdk-core MIME type file duplicate-->
<ignoredResourcePattern>mime.types</ignoredResourcePattern>
<ignoredResourcePattern>about.html</ignoredResourcePattern>
</ignoredResourcePatterns>
</configuration>
</plugin>
</plugins>
</build>
</profile>
Expand All @@ -405,5 +448,25 @@
</plugins>
</build>
</profile>

<profile>
<id>test-failure-recovery</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- Failure recovery tests spend most of the time waiting for a retry -->
<threadCount>4</threadCount>
<includes>
<include>**/TestDelta*FailureRecoveryTest.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</profile>

</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class DeltaLakeInsertTableHandle
private final MetadataEntry metadataEntry;
private final List<DeltaLakeColumnHandle> inputColumns;
private final long readVersion;
private final boolean retriesEnabled;

@JsonCreator
public DeltaLakeInsertTableHandle(
Expand All @@ -40,14 +41,16 @@ public DeltaLakeInsertTableHandle(
@JsonProperty("location") String location,
@JsonProperty("metadataEntry") MetadataEntry metadataEntry,
@JsonProperty("inputColumns") List<DeltaLakeColumnHandle> inputColumns,
@JsonProperty("readVersion") long readVersion)
@JsonProperty("readVersion") long readVersion,
@JsonProperty("retriesEnabled") boolean retriesEnabled)
{
this.schemaName = requireNonNull(schemaName, "schemaName is null");
this.tableName = requireNonNull(tableName, "tableName is null");
this.metadataEntry = requireNonNull(metadataEntry, "metadataEntry is null");
this.inputColumns = ImmutableList.copyOf(inputColumns);
this.location = requireNonNull(location, "location is null");
this.readVersion = readVersion;
this.retriesEnabled = retriesEnabled;
}

@JsonProperty
Expand Down Expand Up @@ -85,4 +88,10 @@ public long getReadVersion()
{
return readVersion;
}

@JsonProperty
public boolean isRetriesEnabled()
{
return retriesEnabled;
}
}
Loading

0 comments on commit b43e7c1

Please sign in to comment.