Skip to content

Commit 2aab91d

Browse files
authored
[FLINK-30237][coordination] Only bundle single ZK client
1 parent ee4d5b8 commit 2aab91d

9 files changed

Lines changed: 13 additions & 93 deletions

File tree

docs/content.zh/docs/deployment/ha/zookeeper_ha.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,6 @@ Enabling this feature will make Flink more resilient against temporary connectio
111111

112112
For more information take a look at [Curator's error handling](https://curator.apache.org/errors.html).
113113

114-
## ZooKeeper 版本
115-
116-
Flink 附带了 3.4 和 3.5 的单独的 ZooKeeper 客户端,其中 3.4 位于发行版的 `lib` 目录中,为默认使用版本,而 3.5 位于 opt 目录中。
117-
118-
3.5 客户端允许你通过 SSL 保护 ZooKeeper 连接,但 _可能_ 不适用于 3.4 版本的 ZooKeeper 安装。
119-
120-
你可以通过在 `lib` 目录中放置任意一个 jar 来控制 Flink 使用哪个版本。
121-
122-
{{< top >}}
123-
124114
<a name="bootstrap-zookeeper" />
125115

126116
## 启动 ZooKeeper

docs/content/docs/deployment/ha/zookeeper_ha.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -118,17 +118,6 @@ Enabling this feature will make Flink more resilient against temporary connectio
118118

119119
For more information take a look at [Curator's error handling](https://curator.apache.org/errors.html).
120120

121-
## ZooKeeper Versions
122-
123-
Flink ships with separate ZooKeeper clients for 3.4 and 3.5, with 3.4 being in the `lib` directory of the distribution
124-
and thus used by default, whereas 3.5 is placed in the `opt` directory.
125-
126-
The 3.5 client allows you to secure the ZooKeeper connection via SSL, but _may_ not work with 3.4- ZooKeeper installations.
127-
128-
You can control which version is used by Flink by placing either jar in the `lib` directory.
129-
130-
{{< top >}}
131-
132121
## Bootstrap ZooKeeper
133122

134123
If you don't have a running ZooKeeper installation, you can use the helper scripts, which ship with Flink.

flink-dist/pom.xml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ under the License.
3333
<packaging>jar</packaging>
3434

3535
<properties>
36-
<zookeeper.optional.version>3.6.3</zookeeper.optional.version>
3736
<japicmp.skip>true</japicmp.skip>
3837
</properties>
3938

@@ -628,25 +627,6 @@ under the License.
628627
<outputDirectory>${project.build.directory}/temporary/java11_exclusive</outputDirectory>
629628
</configuration>
630629
</execution>
631-
<execution>
632-
<id>copy-zk-jars</id>
633-
<phase>process-resources</phase>
634-
<goals>
635-
<goal>copy</goal>
636-
</goals>
637-
<configuration>
638-
<artifactItems>
639-
<artifactItem>
640-
<groupId>org.apache.flink</groupId>
641-
<artifactId>flink-shaded-zookeeper-3</artifactId>
642-
<version>${zookeeper.optional.version}-${flink.shaded.version}</version>
643-
<type>jar</type>
644-
<overWrite>true</overWrite>
645-
</artifactItem>
646-
</artifactItems>
647-
<outputDirectory>${project.build.directory}/temporary</outputDirectory>
648-
</configuration>
649-
</execution>
650630
</executions>
651631
</plugin>
652632

@@ -702,8 +682,6 @@ under the License.
702682
<excludes>
703683
<!-- log4j 2 is bundled separately from the flink-dist jar -->
704684
<exclude>org.apache.logging.log4j:*</exclude>
705-
<!-- Bundled separately so that users can easily switch between ZK 3.4/3.5-->
706-
<exclude>org.apache.flink:flink-shaded-zookeeper-3</exclude>
707685
</excludes>
708686
</artifactSet>
709687
</configuration>

flink-dist/src/main/assemblies/bin.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,6 @@ under the License.
4444
<include>org.apache.logging.log4j:log4j-1.2-api</include>
4545
</includes>
4646
</dependencySet>
47-
<dependencySet>
48-
<outputDirectory>lib</outputDirectory>
49-
<unpack>false</unpack>
50-
<includes>
51-
<include>org.apache.flink:flink-shaded-zookeeper-3:jar:${zookeeper.version}-${flink.shaded.version}</include>
52-
</includes>
53-
<outputFileNameMapping>flink-shaded-zookeeper-${zookeeper.version}.jar</outputFileNameMapping>
54-
</dependencySet>
5547
</dependencySets>
5648

5749
<files>

flink-dist/src/main/assemblies/opt.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,6 @@
115115
<destName>flink-python-${project.version}.jar</destName>
116116
<fileMode>0644</fileMode>
117117
</file>
118-
119-
<file>
120-
<source>target/temporary/flink-shaded-zookeeper-3-${zookeeper.optional.version}-${flink.shaded.version}.jar</source>
121-
<outputDirectory>opt</outputDirectory>
122-
<destName>flink-shaded-zookeeper-${zookeeper.optional.version}.jar</destName>
123-
<fileMode>0644</fileMode>
124-
</file>
125118
</files>
126119
<fileSets>
127120
<fileSet>

flink-end-to-end-tests/run-nightly-tests.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,15 @@ function run_group_1 {
162162

163163
run_test "Running HA dataset end-to-end test" "$END_TO_END_DIR/test-scripts/test_ha_dataset.sh" "skip_check_exceptions"
164164

165-
run_test "Running HA (hashmap, async) end-to-end test" "$END_TO_END_DIR/test-scripts/test_ha_datastream.sh hashmap true false 3.6" "skip_check_exceptions"
166-
run_test "Running HA (hashmap, sync) end-to-end test" "$END_TO_END_DIR/test-scripts/test_ha_datastream.sh hashmap false false 3.5" "skip_check_exceptions"
167-
run_test "Running HA (rocks, non-incremental) end-to-end test" "$END_TO_END_DIR/test-scripts/test_ha_datastream.sh rocks true false 3.6" "skip_check_exceptions"
168-
run_test "Running HA (rocks, incremental) end-to-end test" "$END_TO_END_DIR/test-scripts/test_ha_datastream.sh rocks true true 3.5" "skip_check_exceptions"
169-
170-
run_test "Running HA per-job cluster (hashmap, async) end-to-end test" "$END_TO_END_DIR/test-scripts/test_ha_per_job_cluster_datastream.sh hashmap true false 3.6" "skip_check_exceptions"
171-
run_test "Running HA per-job cluster (hashmap, sync) end-to-end test" "$END_TO_END_DIR/test-scripts/test_ha_per_job_cluster_datastream.sh hashmap false false 3.5" "skip_check_exceptions"
172-
run_test "Running HA per-job cluster (rocks, non-incremental) end-to-end test" "$END_TO_END_DIR/test-scripts/test_ha_per_job_cluster_datastream.sh rocks true false 3.6" "skip_check_exceptions"
173-
run_test "Running HA per-job cluster (rocks, incremental) end-to-end test" "$END_TO_END_DIR/test-scripts/test_ha_per_job_cluster_datastream.sh rocks true true 3.5" "skip_check_exceptions"
165+
run_test "Running HA (hashmap, async) end-to-end test" "$END_TO_END_DIR/test-scripts/test_ha_datastream.sh hashmap true false" "skip_check_exceptions"
166+
run_test "Running HA (hashmap, sync) end-to-end test" "$END_TO_END_DIR/test-scripts/test_ha_datastream.sh hashmap false false" "skip_check_exceptions"
167+
run_test "Running HA (rocks, non-incremental) end-to-end test" "$END_TO_END_DIR/test-scripts/test_ha_datastream.sh rocks true false" "skip_check_exceptions"
168+
run_test "Running HA (rocks, incremental) end-to-end test" "$END_TO_END_DIR/test-scripts/test_ha_datastream.sh rocks true true" "skip_check_exceptions"
169+
170+
run_test "Running HA per-job cluster (hashmap, async) end-to-end test" "$END_TO_END_DIR/test-scripts/test_ha_per_job_cluster_datastream.sh hashmap true false" "skip_check_exceptions"
171+
run_test "Running HA per-job cluster (hashmap, sync) end-to-end test" "$END_TO_END_DIR/test-scripts/test_ha_per_job_cluster_datastream.sh hashmap false false" "skip_check_exceptions"
172+
run_test "Running HA per-job cluster (rocks, non-incremental) end-to-end test" "$END_TO_END_DIR/test-scripts/test_ha_per_job_cluster_datastream.sh rocks true false" "skip_check_exceptions"
173+
run_test "Running HA per-job cluster (rocks, incremental) end-to-end test" "$END_TO_END_DIR/test-scripts/test_ha_per_job_cluster_datastream.sh rocks true true" "skip_check_exceptions"
174174
}
175175

176176
function run_group_2 {

flink-end-to-end-tests/test-scripts/common.sh

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -114,22 +114,6 @@ function revert_flink_dir() {
114114
CURL_SSL_ARGS=""
115115
}
116116

117-
function setup_flink_shaded_zookeeper() {
118-
local version=$1
119-
# if it is already in lib we don't have to do anything
120-
if ! [ -e "${FLINK_DIR}"/lib/flink-shaded-zookeeper-${version}* ]; then
121-
if ! [ -e "${FLINK_DIR}"/opt/flink-shaded-zookeeper-${version}* ]; then
122-
echo "Could not find ZK ${version} in opt or lib."
123-
exit 1
124-
else
125-
# contents of 'opt' must not be changed since it is not backed up in common.sh#backup_flink_dir
126-
# it is fine to delete jars from 'lib' since it is backed up and will be restored after the test
127-
rm "${FLINK_DIR}"/lib/flink-shaded-zookeeper-*
128-
cp "${FLINK_DIR}"/opt/flink-shaded-zookeeper-${version}* "${FLINK_DIR}/lib"
129-
fi
130-
fi
131-
}
132-
133117
function add_optional_lib() {
134118
local lib_name=$1
135119
cp "$FLINK_DIR/opt/flink-${lib_name}"*".jar" "$FLINK_DIR/lib"

flink-end-to-end-tests/test-scripts/test_ha_datastream.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ function run_ha_test() {
3434
local BACKEND=$2
3535
local ASYNC=$3
3636
local INCREM=$4
37-
local ZOOKEEPER_VERSION=$5
3837

3938
local JM_KILLS=2
4039
local CHECKPOINT_DIR="${TEST_DATA_DIR}/checkpoints/"
@@ -47,11 +46,10 @@ function run_ha_test() {
4746
# jm killing loop
4847
set_config_key "env.pid.dir" "${TEST_DATA_DIR}"
4948
set_config_key "env.java.opts.all" "-ea"
50-
setup_flink_shaded_zookeeper ${ZOOKEEPER_VERSION}
5149
start_local_zk
5250
start_cluster
5351

54-
echo "Running on HA mode: parallelism=${PARALLELISM}, backend=${BACKEND}, asyncSnapshots=${ASYNC}, incremSnapshots=${INCREM} and zk=${ZOOKEEPER_VERSION}."
52+
echo "Running on HA mode: parallelism=${PARALLELISM}, backend=${BACKEND}, asyncSnapshots=${ASYNC}, incremSnapshots=${INCREM}."
5553

5654
# submit a job in detached mode and let it run
5755
local JOB_ID=$($FLINK_DIR/bin/flink run -d -p ${PARALLELISM} \
@@ -98,6 +96,5 @@ function run_ha_test() {
9896
STATE_BACKEND_TYPE=${1:-file}
9997
STATE_BACKEND_FILE_ASYNC=${2:-true}
10098
STATE_BACKEND_ROCKS_INCREMENTAL=${3:-false}
101-
ZOOKEEPER_VERSION=${4:-3.5}
10299

103-
run_test_with_timeout 900 run_ha_test 4 ${STATE_BACKEND_TYPE} ${STATE_BACKEND_FILE_ASYNC} ${STATE_BACKEND_ROCKS_INCREMENTAL} ${ZOOKEEPER_VERSION}
100+
run_test_with_timeout 900 run_ha_test 4 ${STATE_BACKEND_TYPE} ${STATE_BACKEND_FILE_ASYNC} ${STATE_BACKEND_ROCKS_INCREMENTAL}

flink-end-to-end-tests/test-scripts/test_ha_per_job_cluster_datastream.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ function run_ha_test() {
9797
local BACKEND=$2
9898
local ASYNC=$3
9999
local INCREM=$4
100-
local ZOOKEEPER_VERSION=$5
101100

102101
local JM_KILLS=2
103102

@@ -113,10 +112,9 @@ function run_ha_test() {
113112
# jm killing loop
114113
set_config_key "env.pid.dir" "${TEST_DATA_DIR}"
115114

116-
setup_flink_shaded_zookeeper ${ZOOKEEPER_VERSION}
117115
start_local_zk
118116

119-
echo "Running on HA mode: parallelism=${PARALLELISM}, backend=${BACKEND}, asyncSnapshots=${ASYNC}, incremSnapshots=${INCREM} and zk=${ZOOKEEPER_VERSION}."
117+
echo "Running on HA mode: parallelism=${PARALLELISM}, backend=${BACKEND}, asyncSnapshots=${ASYNC}, incremSnapshots=${INCREM}."
120118

121119
# submit a job in detached mode and let it run
122120
run_job ${PARALLELISM} ${BACKEND} ${ASYNC} ${INCREM}
@@ -154,6 +152,5 @@ function run_ha_test() {
154152
STATE_BACKEND_TYPE=${1:-file}
155153
STATE_BACKEND_FILE_ASYNC=${2:-true}
156154
STATE_BACKEND_ROCKS_INCREMENTAL=${3:-false}
157-
ZOOKEEPER_VERSION=${4:-3.5}
158155

159-
run_test_with_timeout 900 run_ha_test 4 ${STATE_BACKEND_TYPE} ${STATE_BACKEND_FILE_ASYNC} ${STATE_BACKEND_ROCKS_INCREMENTAL} ${ZOOKEEPER_VERSION}
156+
run_test_with_timeout 900 run_ha_test 4 ${STATE_BACKEND_TYPE} ${STATE_BACKEND_FILE_ASYNC} ${STATE_BACKEND_ROCKS_INCREMENTAL}

0 commit comments

Comments
 (0)