leizhiyuan opened a new issue, #942:
URL: https://github.com/apache/rocketmq-externals/issues/942
## English
### Environment
- Arch: `aarch64`
- OS: CentOS 7.x / TencentOS Server 3.x (glibc 2.17 / 2.28), also Kylin /
UOS ARM editions
- JDK: 8 / 11
- Artifact: `org.apache.rocketmq:rocketmq-rocksdb:1.0.6` (consumed by
RocketMQ 5.x `store` / `controller`)
### Problem
The `librocksdbjni-linux-aarch64.so` shipped inside the jar cannot be loaded
on aarch64 hosts whose glibc is lower than 2.29. The JVM fails with:
```
java.lang.UnsatisfiedLinkError: /tmp/librocksdbjni...so:
/lib64/libc.so.6: version `GLIBC_2.29' not found (required by
/tmp/librocksdbjni...so)
at org.rocksdb.NativeLibraryLoader...
at org.rocksdb.RocksDB.loadLibrary(RocksDB.java:67)
at org.rocksdb.RocksDB.<clinit>(RocksDB.java:36)
```
so any RocketMQ process that touches RocksDB (message store,
controller/jraft log storage) cannot start on these ARM hosts, even though the
same jar works on x86_64 with the very same OS.
Checking the published artifacts shows this is a regression introduced in
1.0.4 and never fixed for aarch64 (x86_64 was fixed in 1.0.5):
| release | `librocksdbjni-linux64.so` max GLIBC |
`librocksdbjni-linux-aarch64.so` max GLIBC | aarch64 toolchain (`.comment`) |
|---|---|---|---|
| 1.0.2 | 2.12 | *not shipped* | – |
| 1.0.3 | 2.12 | **2.17** | GCC 7.3.1 20180303 (Red Hat) |
| 1.0.4 | 2.30 | 2.30 | GCC 10.2.1 (Alibaba 10.2.1-3.8) |
| 1.0.5 | 2.16 | 2.30 | GCC 10.2.1 (Alibaba 10.2.1-3.8) |
| 1.0.6 | 2.16 | **2.30** | GCC 10.2.1 (Alibaba 10.2.1-3.8) |
Reproduction of the numbers above:
```bash
unzip -o rocketmq-rocksdb-<ver>.jar librocksdbjni-linux-aarch64.so
librocksdbjni-linux64.so -d x
readelf -V x/librocksdbjni-linux-aarch64.so | grep -oE 'GLIBC_[0-9.]+' |
sort -uV | tail -1
readelf -V x/librocksdbjni-linux64.so | grep -oE 'GLIBC_[0-9.]+' |
sort -uV | tail -1
readelf -p .comment x/librocksdbjni-linux-aarch64.so
```
i.e. aarch64 was usable on glibc 2.17 in 1.0.3, then the requirement jumped
to 2.30 in 1.0.4; the 1.0.5/1.0.6 releases brought only the x86_64 binary back
to a low glibc baseline, while the aarch64 binary stayed on the Alibaba Cloud
Linux 3 build. For reference, the aarch64 symbols needed by the 1.0.6 build
(`GLIBC_2.29`, `GLIBC_2.30`) do not exist in glibc 2.17–2.28, so no runtime
workaround is possible.
Related: apache/rocketmq#9532 reported the earlier state (1.0.2 shipped no
aarch64 binary at all). The aarch64 binary exists since 1.0.3/1.0.4, but is
still unloadable on the platforms above.
### Need
1. aarch64 binaries of `rocketmq-rocksdb` that are loadable on the same
low-glibc baseline as the x86_64 binary (glibc 2.17, i.e. CentOS 7 / TencentOS
3 / Kylin / UOS ARM hosts) — as it already was in 1.0.3.
2. The minimum glibc requirement per platform documented in
`rocketmq-rocksdb/README.md` (including the toolchain/distro used for each
binary), so users can tell from the release notes whether a given artifact runs
on their OS.
---
## 中文
### 环境
- 架构:`aarch64`
- 系统:CentOS 7.x / TencentOS Server 3.x(glibc 2.17 / 2.28),以及麒麟 / 统信 ARM 版
- JDK:8 / 11
- 依赖:`org.apache.rocketmq:rocketmq-rocksdb:1.0.6`(RocketMQ 5.x 的 `store` /
`controller` 使用)
### 问题
jar 内的 `librocksdbjni-linux-aarch64.so` 在 glibc 低于 2.29 的 aarch64
机器上无法加载,JVM 直接报:
```
java.lang.UnsatisfiedLinkError: /tmp/librocksdbjni...so:
/lib64/libc.so.6: version `GLIBC_2.29' not found (required by
/tmp/librocksdbjni...so)
```
于是所有用到 RocksDB 的 RocketMQ 进程(消息存储、controller/jraft log storage)在这些 ARM
机器上无法启动,而同一个 jar 在同样系统的 x86_64 上是正常的。
逐个版本核对后发现这是 1.0.4 引入、且 aarch64 一直未修的回退(x86_64 在 1.0.5 已修回):
| 版本 | `librocksdbjni-linux64.so` 最高 GLIBC |
`librocksdbjni-linux-aarch64.so` 最高 GLIBC | aarch64 构建工具链(`.comment`) |
|---|---|---|---|
| 1.0.2 | 2.12 | 未提供 | – |
| 1.0.3 | 2.12 | **2.17** | GCC 7.3.1 20180303 (Red Hat) |
| 1.0.4 | 2.30 | 2.30 | GCC 10.2.1 (Alibaba 10.2.1-3.8) |
| 1.0.5 | 2.16 | 2.30 | GCC 10.2.1 (Alibaba 10.2.1-3.8) |
| 1.0.6 | 2.16 | **2.30** | GCC 10.2.1 (Alibaba 10.2.1-3.8) |
复现方式:
```bash
unzip -o rocketmq-rocksdb-<ver>.jar librocksdbjni-linux-aarch64.so
librocksdbjni-linux64.so -d x
readelf -V x/librocksdbjni-linux-aarch64.so | grep -oE 'GLIBC_[0-9.]+' |
sort -uV | tail -1
readelf -V x/librocksdbjni-linux64.so | grep -oE 'GLIBC_[0-9.]+' |
sort -uV | tail -1
readelf -p .comment x/librocksdbjni-linux-aarch64.so
```
即:aarch64 在 1.0.3 时是 glibc 2.17 可用的,1.0.4 起跳到 2.30;1.0.5 / 1.0.6 只把 x86_64
拉回低 glibc 基线,aarch64 仍是在 Alibaba Cloud Linux 3 上编的那份。1.0.6 需要的 `GLIBC_2.29` /
`GLIBC_2.30` 符号在 glibc 2.17–2.28 中并不存在,因此没有任何运行期规避手段。
相关:apache/rocketmq#9532 反映的是更早的状态(1.0.2 完全没有 aarch64 二进制)。aarch64 二进制从 1.0.3
/ 1.0.4 起有了,但在上述平台上依然加载不了。
### 需求
1. `rocketmq-rocksdb` 的 aarch64 二进制与 x86_64 保持同一低 glibc 基线(glibc 2.17,即
CentOS 7 / TencentOS 3 / 麒麟 / 统信 ARM 机器可加载),恢复 1.0.3 时的水平。
2. 在 `rocketmq-rocksdb/README.md` 中明确列出各平台二进制的最低 glibc
要求(以及各自使用的工具链/构建系统),便于使用者从 release 说明判断产物能否在自己的系统上运行。
--
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]