Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible problems with AOF used in slaves #245

Closed
antirez opened this issue Dec 13, 2011 · 6 comments
Closed

Possible problems with AOF used in slaves #245

antirez opened this issue Dec 13, 2011 · 6 comments
Assignees
Milestone

Comments

@antirez
Copy link
Contributor

antirez commented Dec 13, 2011

There are a few of interactions about AOF used by Redis slave instances that should be investigated better before the release of Redis 2.6. The fixes should be backported to Redis 2.4 if possible.

  • When a slave successfully synchs with its master, and AOF is enabled, an AOF rewrite gets triggered. What happens if the AOF rewrite was already in progress? Probably the new rewrite fails to be started. The correct solution is to kill the old child and spawn a new one.
  • An instance used to be a master with its AOF, or that was a slave with its AOF, and is now performing a synchronization with a new master, or with the same master after a link down. Now the instance just finished to perform the synchronization, and triggers the rewrite, that spawns a child, and so forth. In the meantime write queries will arrive from the master: where they end being written? In the old AOF that is about a different data set entirely? That's completely broken. Once a slave successfully performs a remote sync it should remove the old AOF at all unlinking it and reopening it. Then no new data should be written to the AOF before the rewrite of the AOF is not finished.
  • Improve logging of what happens when write(2) against the AOF fails.
@ghost ghost assigned antirez Dec 13, 2011
@Poincare
Copy link
Contributor

Could you explain what AOF means?

@janoberst
Copy link
Contributor

I believe by AOF he means "append only file", an option you can choose in Redis to make it write every command it executes to disk.

@Poincare
Copy link
Contributor

Thanks (not quite familiar with the lingo here :)

For the first problem, I think that maybe we need some sort of state machine type thing going on, with WRITING and IDLE states.

If this is agreed to, I'll be glad to help for the implementation.

@antirez
Copy link
Contributor Author

antirez commented Dec 14, 2011

@Poincare actually the implementation is trivial, this are not missed features but just overlooked races, I tend to take care of this subtle aspects of the semantics myself given that to review code from another developer would require the same time as implementing it myself. Thanks for the offer.

@Poincare
Copy link
Contributor

Alright.

@antirez
Copy link
Contributor Author

antirez commented Jan 12, 2012

Issues fixed in the unstable branch.

@antirez antirez closed this as completed Jan 12, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants