Skip to content

fix: preserve obdiag command across RPM upgrades - #1265

Merged
hidb4ai merged 2 commits into
oceanbase:masterfrom
askdb:codex/fix-1264-rpm-command-entry
Oct 15, 2026
Merged

hidb4ai merged 2 commits into
oceanbase:masterfrom
askdb:codex/fix-1264-rpm-command-entry

Conversation

@askdb

@askdb askdb commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Problem

RPM upgrades can finish successfully while leaving obdiag unavailable in PATH. The new package creates /usr/bin/obdiag in %post, then the old package's unconditional %preun deletes it. This also affects merged-/usr systems where /bin points to /usr/bin.

Fixes #1264

Changes

  • Restrict command-link cleanup to final removal, preserving links during RPM upgrades. Also recognize remove from the existing alien --scripts conversion path.
  • Restore the link in %posttrans, after old-package cleanup, so the first upgrade from an already released affected RPM works too.
  • Retain link creation and initialization guidance in %post for converted DEB packages, and add the subsequent obdiag --version verification instruction at the end of the RPM transaction.
  • Add eleven regression tests covering installation, legacy upgrades, nonzero remaining-package counts, merged-/usr paths, repeated setup, final removal, converted-DEB script arguments, and guidance ordering. Run them in a dedicated dependency-free CI job.

Validation

  • python -m pytest test/common/test_rpm_lifecycle.py -v: 11 passed and 4 parameter subtests passed.
  • python -m unittest discover -s test/common -p 'test_rpm_lifecycle.py' -v: 11 tests passed.
  • Negative control against the original spec: 6 regression tests fail, with no test harness errors.
  • black --check -S -l 256 .: passed (443 files unchanged).
  • python3 workflow_data/check_py_files.py .: passed in a clean source-tree copy. The existing local ignored build/ directory contains generated copies without the expected headers, so the check in the original workspace reports those pre-existing artifacts.
  • git diff --check: passed.

Real RPM transaction validation passed in a disposable Oracle Linux 9 aarch64 container with RPM 4.16.1.3. Four minimal-payload RPM fixtures used the unmodified legacy and final current spec scriptlets:

  • Legacy-to-legacy upgrade reproduced the missing command.
  • Legacy-to-fixed upgrade restored the command after old-package cleanup.
  • Fixed-to-fixed upgrade and --replacepkgs reinstall retained a working command.
  • Fresh installation created the command; final removal deleted both command paths.

These fixtures exercise real rpm -ivh, rpm -Uvh, and rpm -e transactions. Their payload uses a small executable and initialization/backup stubs; this does not substitute for a full production PyInstaller/RPM build. Full package builds are covered by the existing GitHub workflow.

CI notes

On final revision 3443f80f6c7cd9bf94734b45b109a6d392a8507c, RPM lifecycle tests, common-module tests, SQL tests, formatting, header checks, CodeQL, and CLA passed. The package workflow has successfully built the CentOS 8 RPM, macOS ARM64 package, and native Ubuntu/Debian package; the DEB installation test also passed. See the workflow run for the remaining CentOS 7, converted-DEB, and OceanBase integration job results.

The unrelated repository translator failed with HTTPError from lizheming/github-translate-action. One retry failed with the same result. The log also reports that the translated body is null or unchanged. This PR does not change the translator workflow.

@hidb4ai hidb4ai left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hidb4ai
hidb4ai merged commit 4a46a0d into oceanbase:master Oct 15, 2026
18 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: RPM upgrade removes the obdiag command entry point

2 participants