smaheshwar-pltr commented on code in PR #18247: URL: https://github.com/apache/iceberg/pull/18247#discussion_r4097843309
########## aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOWithLegacyMinIO.java: ########## @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.iceberg.aws.s3; - -import org.testcontainers.containers.MinIOContainer; -import org.testcontainers.junit.jupiter.Testcontainers; - -@Testcontainers -public class TestS3FileIOWithLegacyMinIO extends TestS3FileIO { - @Override - protected MinIOContainer createMinIOContainer() { - MinIOContainer container = MinioUtil.createContainer(MinioUtil.LEGACY_TAG, null); - container.start(); - return container; - } - - @Override - protected boolean legacyMd5PluginEnabled() { - return true; Review Comment: Removing this rather than porting it: re-running the whole suite only tested something because this MinIO release enforced MD5, and RustFS doesn't. The plugin only adds MD5 to operations that require a checksum, and the only one this suite exercises is DeleteObjects. That case is now covered by `TestS3FileIOLegacyMd5`, without needing an old server image. ########## aws/src/test/java/org/apache/iceberg/aws/s3/TestS3FileIOLegacyMd5.java: ########## @@ -0,0 +1,114 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.iceberg.aws.s3; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.mockserver.integration.ClientAndServer.startClientAndServer; +import static org.mockserver.model.HttpRequest.request; +import static org.mockserver.model.HttpResponse.response; + +import java.security.MessageDigest; +import java.util.Base64; +import java.util.List; +import java.util.Map; +import org.apache.iceberg.aws.AwsClientProperties; +import org.apache.iceberg.io.BulkDeletionFailureException; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockserver.integration.ClientAndServer; +import org.mockserver.model.HttpRequest; + +class TestS3FileIOLegacyMd5 { Review Comment: This replaces the [old legacy-MinIO subclass](https://github.com/apache/iceberg/blob/3957d26daa535eb5f03e101f1210ee234e978f9a/aws/src/integration/java/org/apache/iceberg/aws/s3/TestS3FileIOWithLegacyMinIO.java#L24-L35). That MinIO release rejected bulk deletes without `Content-MD5`, which is why Iceberg has [`client.legacy-md5-plugin-enabled`](https://github.com/apache/iceberg/blob/3957d26daa535eb5f03e101f1210ee234e978f9a/aws/src/main/java/org/apache/iceberg/aws/AwsClientProperties.java#L86-L92). RustFS accepts deletes with or without it, so running the suite against RustFS with the plugin on would pass either way. This fixture enforces the old server's requirement instead. It checks that deletes succeed with the option and are rejected without it. It also goes through the real `S3FileIO` property path, which the old subclass skipped by adding the plugin directly to the client. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
