AWS: s3.preload-client-enabled no longer creates the S3 client in S3FileIO.initialize()
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start in S3FileIO.initialize() and clientByPrefix(), where the S3 client is created lazily, and compare with the PrefixedS3Client constructor that checks S3FileIOProperties.PRELOAD_CLIENT_ENABLED. Add the counting-factory test from the issue to TestS3FileIOProperties or the S3FileIO tests and confirm it fails. Before changing code, settle the open Lake Formation question with the maintainers, since it decides whether to restore the eager client() call in initialize() or deprecate the flag and stop setting it in GlueCatalog.newTableOps.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
Since 1.10.0, s3.preload-client-enabled (S3FileIOProperties.PRELOAD_CLIENT_ENABLED) no longer creates the S3 client in S3FileIO.initialize(), although its Javadoc still says: "This flag controls whether the S3 client will be initialized during the S3FileIO initialization, instead of default lazy initialization upon use."
Up to 1.9.x, initialize() called client() when the flag was set. #12799 moved client creation into PrefixedS3Client and the flag check into its constructor, but S3FileIO creates its PrefixedS3Clients lazily in clientByPrefix() on the first file operation. So initialize() no longer creates any client, and the flag only makes the sync client get built together with the client map. Nothing tests the eager behavior: TestS3FileIOProperties only checks that the flag is parsed.
Reproduction
This test fails on main:
private static final AtomicInteger S3_CLIENTS = new AtomicInteger();
@Test
void preloadCreatesClientInInitialize() {
try (S3FileIO fileIO = new S3FileIO()) {
fileIO.initialize(
ImmutableMap.of(
S3FileIOProperties.CLIENT_FACTORY,
CountingFactory.class.getName(),
S3FileIOProperties.PRELOAD_CLIENT_ENABLED,
"true"));
assertThat(S3_CLIENTS).hasValue(1);
}
}
public static class CountingFactory implements S3FileIOAwsClientFactory {
@Override
public S3Client s3() {
S3_CLIENTS.incrementAndGet();
return Mockito.mock(S3Client.class);
}
@Override
public S3AsyncClient s3Async() {
return Mockito.mock(S3AsyncClient.class);
}
@Override
public void initialize(Map<String, String> properties) {}
}
java.lang.AssertionError:
Expecting AtomicInteger(0) to have value:
1
but did not.
Lake Formation
The only in-tree user is GlueCatalog.newTableOps, which sets the flag for every table when glue.lakeformation-enabled is true (#5756). The eager behavior is also what broke #10226 (create table) and #14766 (loading a missing table from Kafka Connect): newTableOps initializes the table's FileIO right away (today through FileIOTracker.track), so initialize() reached LakeFormationAwsClientFactory.isTableRegisteredWithLakeFormation() before the Glue table existed and threw Glue's EntityNotFoundException. Since #12799, S3FileIO.initialize() no longer calls the factory's s3(), so that path is gone.
Question
Does Lake Formation still need the client to be created in initialize()?
- If it does: restore the
client()call inS3FileIO.initialize()(storage credentials are already set by then, becauseCatalogUtil.loadFileIOcallssetCredentialsfirst), cover it with the test above, and keepGlueCatalogfrom requesting preload for a table that does not exist yet, so #10226 does not come back. - If it does not: deprecate the flag and stop setting it in
GlueCatalog.
cc @xiaoxuandev @jackye1995 @singhpk234
- Lingua principale
- Java
- Stelle
- 9.4k
- Fork
- 3.7k
- Merge medio
- 2g 15h
- PR unite (30g)
- 169
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/iceberg
-
Spark: Test INSERT targets with computed IDENTIFIER expressionsForse già presa @shivadarshan-devadiga l’ha presa 7 giorni fa. Apertaimprovement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
[Core] TestAvroPartitionStatsHandler fails on Windows due to unclosed partition statistics scanForse già presa @Ankitkj1999 l’ha presa 9 giorni fa. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Flink: JdbcLockFactory concurrent lock-table creation can fail with "table already exists" and restart the jobForse già presa @adiranjan25 l’ha presa 16 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
apache/iceberg#18797 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Core: TableMetadata.Builder allows adding encryption keys to v1/v2 tablesForse già presa @yusufyildiz34 l’ha presa 29 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/iceberg#18632 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Kafka: Filter empty strings and whitespace in IcebergSinkConfig stringToListForse già presa @mohamed-elbrik l’ha presa 34 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di apache/iceberg
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
speakeasy-api/speakeasy#2159 ·
I maintainer di solito rispondono entro 1 giorno
-
area: cli
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
vitruv-tools/NeoJoin#415 ·
I maintainer di solito rispondono entro 1 giorno
-
Quick Installation step 2 installs from the plugin manager, but the plugin isn't published yetAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
jenkinsci/user-guide-ai-chatbot-plugin#132 ·
I maintainer di solito rispondono entro 6 giorni
-
account assessment course feature lecture
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug] 连接达梦时报错,agent 进程启动即退Apertabug db/dameng user-priority/P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno