Skip to content

fix: synchronize role parameters and clear obsolete restore source (release/1.4.0) - #1370

Open
wangyunlai-seekdb wants to merge 7 commits into
oceanbase:release/1.4.0from
wangyunlai-seekdb:codex/fix-server-role-info-github-release-1.4.0
Open

fix: synchronize role parameters and clear obsolete restore source (release/1.4.0)#1370
wangyunlai-seekdb wants to merge 7 commits into
oceanbase:release/1.4.0from
wangyunlai-seekdb:codex/fix-server-role-info-github-release-1.4.0

Conversation

@wangyunlai-seekdb

@wangyunlai-seekdb wangyunlai-seekdb commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Backport of #1369 to release/1.4.0.

Role transitions currently persist server_role_info without refreshing its in-memory parameter value, and promotion leaves the former upstream in log_restore_source. After ACTIVATE STANDBY, ROLE can therefore show PRIMARY while SHOW PARAMETERS still shows a standby role and an obsolete source.

Use the existing ObConfigManager save_config() and got_version() operations to persist each parameter and refresh the in-memory configuration. On planned or failover promotion, save PRIMARY first, then clear log_restore_source before enabling primary writes. If source cleanup fails after PRIMARY is durable, the command returns an error and the obsolete source remains harmless because primary runtime does not start standby log synchronization. Ordinary primary startup and repeated promotion preserve a newly preconfigured source for a future demotion.

The release branch does not contain the basic/crash-reentry obtest suite, so only production changes are backported. Regression assertions are included in master PR #1369.

Validation:

  • Original role-parameter mismatch reproduced twice on 1.4.0.0, including correct SQLite state and refresh after restart.
  • All three modified C++ translation units passed Clang 17 -fsyntax-only with worktree source headers and existing generated/dependency headers, including after combining both fixes.
  • git diff --check passed. Regression command/expected-output consistency was checked on the master PR.
  • Full build and updated obtest runtime execution have not been performed.

@wangyunlai-seekdb wangyunlai-seekdb changed the title fix: refresh server_role_info after role transitions (release/1.4.0) fix: synchronize role parameters and clear obsolete restore source (release/1.4.0) Sep 10, 2026
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.

1 participant