Skip to content

Fail SYNC if background save child aborted due to a signal. - #1896

Merged
antirez merged 1 commit into
redis:unstablefrom
yossigo:bgsave-signal-fix
Jul 28, 2014
Merged

antirez merged 1 commit into
redis:unstablefrom
yossigo:bgsave-signal-fix

Conversation

@yossigo

@yossigo yossigo commented Jul 28, 2014

Copy link
Copy Markdown
Contributor

Currently only exit code is tested, but slaves should get an error also when the child exits because of a signal (e.g. KILL by OOM killer, etc.).

I think not testing this may even result with corrupted replication:

  1. BGSAVE child aborts, so there's no new rdb file.
  2. The main process thinks the BGSAVE completed and sends an OLD RDB to the slave.
  3. The slave loads an old RDB and proceeds to apply the slave output buffer content, but is actually missing everything that was written in-between.

antirez added a commit that referenced this pull request Jul 28, 2014
Fail SYNC if background save child aborted due to a signal.
@antirez
antirez merged commit 78a012d into redis:unstable Jul 28, 2014
@antirez

antirez commented Jul 28, 2014

Copy link
Copy Markdown
Contributor

Good catch! Thanks, merged.

@antirez

antirez commented Jul 28, 2014

Copy link
Copy Markdown
Contributor

p.s. the fix was backported to Redis 2.8, but because is seems unlikely (but not impossible) for people to step into the issue, and there are things that need to stay in the sandbox for a bit more in the 2.8 branch, I'll wait about two weeks for the next 2.8 release instead of providing it ASAP.

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.

2 participants