Skip to content

Commit f42a252

Browse files
authored
Merge branch 'master' into HDDS-11463
2 parents 07370b7 + 2aa71ac commit f42a252

File tree

571 files changed

+24815
-7975
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

571 files changed

+24815
-7975
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
build:
112112
needs:
113113
- build-info
114-
if: needs.build-info.outputs.needs-build == 'true'
114+
if: needs.build-info.outputs.needs-build == 'true' || needs.build-info.outputs.needs-integration-tests == 'true'
115115
uses: ./.github/workflows/check.yml
116116
with:
117117
java-version: ${{ needs.build-info.outputs.java-version }}
@@ -265,7 +265,10 @@ jobs:
265265
integration:
266266
needs:
267267
- build-info
268+
- build
268269
- basic
270+
- dependency
271+
- license
269272
if: needs.build-info.outputs.needs-integration-tests == 'true'
270273
uses: ./.github/workflows/check.yml
271274
secrets: inherit

.github/workflows/intermittent-test-check.yml

Lines changed: 5 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ on:
3030
required: false
3131
submodule:
3232
description: Submodule
33-
default: 'AUTO'
33+
default: 'ozone-integration-test'
3434
required: true
3535
iterations:
3636
description: Number of Iterations per split
@@ -94,54 +94,11 @@ jobs:
9494
with:
9595
repo: ${{ github.event.inputs.ratis-repo || format('{0}/ratis', github.repository_owner) }}
9696
ref: ${{ github.event.inputs.ratis-ref }}
97-
find-tests:
98-
if: ${{ always() && github.event.inputs.submodule == 'AUTO' }}
99-
needs:
100-
- prepare-job
101-
runs-on: ubuntu-24.04
102-
outputs:
103-
modules: ${{ steps.modules.outputs.modules }}
104-
steps:
105-
- uses: actions/checkout@v4
106-
with:
107-
ref: ${{ github.event.inputs.ref }}
108-
- name: Cache for maven dependencies
109-
uses: actions/cache/restore@v4
110-
with:
111-
path: |
112-
~/.m2/repository/*/*/*
113-
!~/.m2/repository/org/apache/ozone
114-
key: maven-repo-${{ hashFiles('**/pom.xml') }}
115-
restore-keys: |
116-
maven-repo-
117-
- name: Setup java
118-
uses: actions/setup-java@v4
119-
with:
120-
distribution: 'temurin'
121-
java-version: ${{ github.event.inputs.java-version }}
122-
- name: Find tests
123-
run: |
124-
# find tests to be run in splits by running them with very short timeout
125-
hadoop-ozone/dev-support/checks/junit.sh -DexcludedGroups="native|slow|unhealthy" -DskipShade \
126-
-Dtest="$TEST_CLASS,Abstract*Test*\$*" \
127-
-Dsurefire.fork.timeout=1 -Dmaven-surefire-plugin.version=${{ env.SUREFIRE_VERSION }} \
128-
|| true # ignore errors
129-
env:
130-
ITERATIONS: 1
131-
- name: Find modules
132-
id: modules
133-
run: |
134-
grep -e 'surefire:${{ env.SUREFIRE_VERSION }}:test' -e 'Running org.apache' target/unit/output.log | grep -B1 'Running org.apache'
135-
modules=$(grep -e 'surefire:${{ env.SUREFIRE_VERSION }}:test' -e 'Running org.apache' target/unit/output.log | grep -B1 'Running org.apache' \
136-
| grep surefire | cut -f2 -d'@' | awk '{ print $1 }' | sed 's/^/:/' | xargs | sed -e 's/ /,/g')
137-
echo "modules=$modules" >> $GITHUB_OUTPUT
138-
if: ${{ !cancelled() }}
13997
build:
14098
if: ${{ always() }}
14199
needs:
142100
- prepare-job
143101
- ratis
144-
- find-tests
145102
runs-on: ubuntu-24.04
146103
timeout-minutes: 60
147104
steps:
@@ -181,11 +138,7 @@ jobs:
181138
args="$args -Dgrpc.protobuf-compile.version=${{ needs.ratis.outputs.protobuf-version }}"
182139
fi
183140
184-
if [[ "${{ github.event.inputs.submodule }}" != "AUTO" ]]; then
185-
args="$args -am -pl :${{ github.event.inputs.submodule }}"
186-
elif [[ -n "${{ needs.find-tests.outputs.modules }}" ]]; then
187-
args="$args -am -pl ${{ needs.find-tests.outputs.modules }}"
188-
fi
141+
args="$args -am -pl :${{ github.event.inputs.submodule }}"
189142
190143
hadoop-ozone/dev-support/checks/build.sh $args
191144
- name: Store Maven repo for tests
@@ -201,7 +154,6 @@ jobs:
201154
- prepare-job
202155
- ratis
203156
- build
204-
- find-tests
205157
name: Run-Split
206158
runs-on: ubuntu-24.04
207159
strategy:
@@ -256,11 +208,7 @@ jobs:
256208
args="$args -Dgrpc.protobuf-compile.version=${{ needs.ratis.outputs.protobuf-version }}"
257209
fi
258210
259-
if [[ "${{ github.event.inputs.submodule }}" != "AUTO" ]]; then
260-
args="$args -pl :${{ github.event.inputs.submodule }}"
261-
elif [[ -n "${{ needs.find-tests.outputs.modules }}" ]]; then
262-
args="$args -pl ${{ needs.find-tests.outputs.modules }}"
263-
fi
211+
args="$args -pl :${{ github.event.inputs.submodule }}"
264212
265213
if [ "$TEST_METHOD" = "ALL" ]; then
266214
echo "Running all tests from $TEST_CLASS"
@@ -292,12 +240,12 @@ jobs:
292240
uses: actions/download-artifact@v4
293241
- name: Count failures
294242
run: |
295-
failures=$(find . -name 'summary.txt' | grep -v 'iteration' | xargs grep -v 'exit code: 0' | wc -l)
243+
failures=$(find . -name 'summary.txt' | grep --text -v 'iteration' | xargs grep --text -v 'exit code: 0' | wc -l)
296244
echo "Total failures: $failures"
297245
if [[ $failures -gt 0 ]]; then
298246
echo ""
299247
echo "Failed runs:"
300-
grep 'exit code: 1' */summary.txt | grep -o 'split.*teration [0-9]*' | sed -e 's/.summary.txt:/ /' -e 's/-/ /' | sort -g -k2 -k4
248+
grep --text 'exit code: 1' */summary.txt | grep --text -o 'split.*teration [0-9]*' | sed -e 's/.summary.txt:/ /' -e 's/-/ /' | sort -g -k2 -k4
301249
echo ""
302250
exit 1
303251
fi

.mvn/extensions.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@
2929
<extension>
3030
<groupId>com.gradle</groupId>
3131
<artifactId>common-custom-user-data-maven-extension</artifactId>
32-
<version>2.0.2</version>
32+
<version>2.0.3</version>
3333
</extension>
3434
</extensions>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
17+
RULE skip notifyGroupRemove
18+
CLASS org.apache.hadoop.ozone.container.common.transport.server.ratis.ContainerStateMachine
19+
METHOD notifyGroupRemove
20+
AT ENTRY
21+
IF TRUE
22+
DO
23+
System.out.println("[" + java.time.LocalDateTime.now() + "] BYTEMAN: " +
24+
"Skip notifyGroupRemove in ContainerStateMachine");
25+
return;
26+
ENDRULE
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
17+
RULE Block putBlock
18+
CLASS org.apache.hadoop.ozone.container.keyvalue.impl.BlockManagerImpl
19+
METHOD putBlock
20+
AT ENTRY
21+
IF TRUE
22+
DO
23+
System.out.println("[" + java.time.LocalDateTime.now() + "] BYTEMAN: " +
24+
"Blocking putBlock in BlockManagerImpl");
25+
return 0;
26+
ENDRULE

hadoop-hdds/client/pom.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,6 @@
110110

111111
<build>
112112
<plugins>
113-
<plugin>
114-
<groupId>com.coderplus.maven.plugins</groupId>
115-
<artifactId>copy-rename-maven-plugin</artifactId>
116-
<executions>
117-
<execution>
118-
<id>rename-generated-config</id>
119-
<phase>process-classes</phase>
120-
</execution>
121-
</executions>
122-
</plugin>
123113
<plugin>
124114
<groupId>com.github.spotbugs</groupId>
125115
<artifactId>spotbugs-maven-plugin</artifactId>

hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockInputStream.java

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
package org.apache.hadoop.hdds.scm.storage;
1919

20-
import static org.apache.hadoop.hdds.client.ReplicationConfig.getLegacyFactor;
21-
2220
import com.google.common.annotations.VisibleForTesting;
2321
import com.google.common.base.Preconditions;
2422
import java.io.EOFException;
@@ -32,7 +30,6 @@
3230
import java.util.concurrent.atomic.AtomicReference;
3331
import java.util.function.Function;
3432
import org.apache.hadoop.hdds.client.BlockID;
35-
import org.apache.hadoop.hdds.client.StandaloneReplicationConfig;
3633
import org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.BlockData;
3734
import org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.ChunkInfo;
3835
import org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.ContainerCommandResponseProto;
@@ -114,6 +111,8 @@ public class BlockInputStream extends BlockExtendedInputStream {
114111

115112
private final Function<BlockID, BlockLocationInfo> refreshFunction;
116113

114+
private BlockData blockData;
115+
117116
public BlockInputStream(
118117
BlockLocationInfo blockInfo,
119118
Pipeline pipeline,
@@ -155,7 +154,6 @@ public synchronized void initialize() throws IOException {
155154
return;
156155
}
157156

158-
BlockData blockData = null;
159157
List<ChunkInfo> chunks = null;
160158
IOException catchEx = null;
161159
do {
@@ -295,10 +293,7 @@ private void setPipeline(Pipeline pipeline) throws IOException {
295293
boolean okForRead =
296294
pipeline.getType() == HddsProtos.ReplicationType.STAND_ALONE
297295
|| pipeline.getType() == HddsProtos.ReplicationType.EC;
298-
Pipeline readPipeline = okForRead ? pipeline : Pipeline.newBuilder(pipeline)
299-
.setReplicationConfig(StandaloneReplicationConfig.getInstance(
300-
getLegacyFactor(pipeline.getReplicationConfig())))
301-
.build();
296+
Pipeline readPipeline = okForRead ? pipeline : pipeline.copyForRead();
302297
pipelineRef.set(readPipeline);
303298
}
304299

@@ -552,8 +547,7 @@ public long getLength() {
552547
return length;
553548
}
554549

555-
@VisibleForTesting
556-
synchronized int getChunkIndex() {
550+
public synchronized int getChunkIndex() {
557551
return chunkIndex;
558552
}
559553

@@ -616,9 +610,12 @@ private void handleReadError(IOException cause) throws IOException {
616610
refreshBlockInfo(cause);
617611
}
618612

619-
@VisibleForTesting
620613
public synchronized List<ChunkInputStream> getChunkStreams() {
621614
return chunkStreams;
622615
}
623616

617+
public BlockData getStreamBlockData() {
618+
return blockData;
619+
}
620+
624621
}

hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/ChunkInputStream.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,4 +742,8 @@ public synchronized void unbuffer() {
742742
public ByteBuffer[] getCachedBuffers() {
743743
return BufferUtils.getReadOnlyByteBuffers(buffers);
744744
}
745+
746+
public ChunkInfo getChunkInfo() {
747+
return chunkInfo;
748+
}
745749
}

hadoop-hdds/client/src/test/java/org/apache/hadoop/hdds/scm/client/TestHddsClientUtils.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ void testVerifyKeyName() throws IllegalArgumentException {
362362

363363
for (String name : validNames) {
364364
HddsClientUtils.verifyKeyName(name);
365+
HddsClientUtils.verifyKeyName(name + OzoneConsts.FS_FILE_COPYING_TEMP_SUFFIX);
365366
}
366367
}
367368

hadoop-hdds/common/pom.xml

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@
4747
<groupId>com.github.stephenc.jcip</groupId>
4848
<artifactId>jcip-annotations</artifactId>
4949
</dependency>
50-
<dependency>
51-
<groupId>com.google.errorprone</groupId>
52-
<artifactId>error_prone_annotations</artifactId>
53-
<optional>true</optional>
54-
</dependency>
5550
<dependency>
5651
<groupId>com.google.guava</groupId>
5752
<artifactId>guava</artifactId>
@@ -76,10 +71,6 @@
7671
<groupId>info.picocli</groupId>
7772
<artifactId>picocli</artifactId>
7873
</dependency>
79-
<dependency>
80-
<groupId>io.dropwizard.metrics</groupId>
81-
<artifactId>metrics-core</artifactId>
82-
</dependency>
8374
<dependency>
8475
<groupId>io.jaegertracing</groupId>
8576
<artifactId>jaeger-core</artifactId>
@@ -101,10 +92,6 @@
10192
<groupId>jakarta.xml.bind</groupId>
10293
<artifactId>jakarta.xml.bind-api</artifactId>
10394
</dependency>
104-
<dependency>
105-
<groupId>javax.annotation</groupId>
106-
<artifactId>javax.annotation-api</artifactId>
107-
</dependency>
10895
<dependency>
10996
<groupId>org.apache.commons</groupId>
11097
<artifactId>commons-lang3</artifactId>
@@ -113,10 +100,6 @@
113100
<groupId>org.apache.hadoop</groupId>
114101
<artifactId>hadoop-common</artifactId>
115102
</dependency>
116-
<dependency>
117-
<groupId>org.apache.ozone</groupId>
118-
<artifactId>hdds-annotation-processing</artifactId>
119-
</dependency>
120103
<dependency>
121104
<groupId>org.apache.ozone</groupId>
122105
<artifactId>hdds-config</artifactId>
@@ -165,14 +148,6 @@
165148
<groupId>org.bouncycastle</groupId>
166149
<artifactId>bcprov-jdk18on</artifactId>
167150
</dependency>
168-
<dependency>
169-
<groupId>org.jetbrains.kotlin</groupId>
170-
<artifactId>kotlin-stdlib</artifactId>
171-
</dependency>
172-
<dependency>
173-
<groupId>org.reflections</groupId>
174-
<artifactId>reflections</artifactId>
175-
</dependency>
176151
<dependency>
177152
<groupId>org.slf4j</groupId>
178153
<artifactId>slf4j-api</artifactId>
@@ -262,20 +237,6 @@
262237
</execution>
263238
</executions>
264239
</plugin>
265-
<plugin>
266-
<groupId>com.coderplus.maven.plugins</groupId>
267-
<artifactId>copy-rename-maven-plugin</artifactId>
268-
<executions>
269-
<execution>
270-
<id>rename-generated-config</id>
271-
<phase>process-classes</phase>
272-
</execution>
273-
<execution>
274-
<id>rename-generated-test-config</id>
275-
<phase>process-test-classes</phase>
276-
</execution>
277-
</executions>
278-
</plugin>
279240
<plugin>
280241
<groupId>com.github.spotbugs</groupId>
281242
<artifactId>spotbugs-maven-plugin</artifactId>

0 commit comments

Comments
 (0)