Skip to content

Fix obtain the AOF file length error when load AOF#9510

Merged
oranagra merged 2 commits intoredis:unstablefrom
chenyang8094:get-aof-size-use-open
Sep 26, 2021
Merged

Fix obtain the AOF file length error when load AOF#9510
oranagra merged 2 commits intoredis:unstablefrom
chenyang8094:get-aof-size-use-open

Conversation

@chenyang8094
Copy link
Contributor

When redis executes loadDataFromDisk after startup, since server.aof_fd is still -1 at this time,aofUpdateCurrentSize will not be able to get the loaded AOF size and will report the following error. I think in this case we can try to use open to get the real size.

57831:M 16 Sep 2021 09:37:25.907 # Server initialized
57831:M 16 Sep 2021 09:37:25.907 # Unable to obtain the AOF file length. stat: Bad file descriptor
57831:M 16 Sep 2021 09:37:25.907 * DB loaded from append only file: 0.000 seconds
57831:M 16 Sep 2021 09:37:25.907 * Ready to accept connections

@oranagra
Copy link
Member

this is a regression from #9012 (luckily not released yet). @YaacovHazan FYI.

@oranagra oranagra added the state:to-be-merged The PR should be merged soon, even if not yet ready, this is used so that it won't be forgotten label Sep 16, 2021
@soloestoy
Copy link
Contributor

Yes, and DEBUG LOADAOF can also generate this error if we don't open appendonly, need fix

@soloestoy
Copy link
Contributor

@soloestoy you are right. This PR is more about the order of opening the files, and the error cleanup is the bonus.
Another deeper PR is needed to sort it out in rdb.c

BTW, has the RDB part work started? @YaacovHazan

@oranagra oranagra merged commit 7c1f9ef into redis:unstable Sep 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state:to-be-merged The PR should be merged soon, even if not yet ready, this is used so that it won't be forgotten

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants