Skip to content

fix(info): the slave lag in INFO command might be overflowed#3271

Merged
PragmaTwice merged 3 commits into
apache:unstablefrom
greatsharp:unstable
Nov 27, 2025
Merged

fix(info): the slave lag in INFO command might be overflowed#3271
PragmaTwice merged 3 commits into
apache:unstablefrom
greatsharp:unstable

Conversation

@greatsharp
Copy link
Copy Markdown
Contributor

we found the master_repl_offset is smaller than slave offset during exec "info replication" command, then the lag value is overflowed

eg:
#Replication
role:master
connected_slaves:2
slave0:xxxxxx
slave1:ip=xxxxx,port=xxxxx,offset=190907912,lag=18446744073709551607
master_repl_offset:190907903

@greatsharp greatsharp changed the title chore(info): fix the info replication command lag value overflowed when master_repl_offset is smaller th… chore(info): fix the info replication command lag value overflowed Nov 25, 2025
@PragmaTwice PragmaTwice requested a review from git-hulk November 26, 2025 05:47
Comment thread src/server/server.cc
git-hulk
git-hulk previously approved these changes Nov 26, 2025
@git-hulk git-hulk enabled auto-merge (squash) November 26, 2025 13:19
@git-hulk git-hulk changed the title chore(info): fix the info replication command lag value overflowed fix(info): the slave lag in INFO command might be wrong Nov 26, 2025
@git-hulk
Copy link
Copy Markdown
Member

@greatsharp Thanks for your contribution!

Copy link
Copy Markdown
Member

@PragmaTwice PragmaTwice left a comment

Choose a reason for hiding this comment

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

I think latest_seq = storage->LatestSeqNumber() should be put after the guard. So that the lag between master seq and replica seq can be more small.

auto-merge was automatically disabled November 26, 2025 15:19

Head branch was pushed to by a user without write access

Comment thread src/server/server.cc
@PragmaTwice PragmaTwice enabled auto-merge (squash) November 27, 2025 02:16
@PragmaTwice PragmaTwice changed the title fix(info): the slave lag in INFO command might be wrong fix(info): the slave lag in INFO command might be overflowed Nov 27, 2025
@PragmaTwice PragmaTwice disabled auto-merge November 27, 2025 02:19
@PragmaTwice PragmaTwice enabled auto-merge (squash) November 27, 2025 02:19
@PragmaTwice PragmaTwice merged commit a7c51db into apache:unstable Nov 27, 2025
67 of 76 checks passed
@sonarqubecloud
Copy link
Copy Markdown

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.

3 participants