antirez/redis — Issue #305: Rewrite AOF: Invalid cross-device link
Author: janoberst
Created: 2012-01-19 14:54:47+00:00
State: open

I get the following error when attempting an AOF rewrite:

```Error trying to rename the temporary AOF: Invalid cross-device link```

The reason: I have the base directory and AOF file on different disks. Since redis just tries to rename() the file atomically, the process fails if the two paths are on different disks.

I have done this to avoid I/O contention: I have all my redis instances write to the same AOF partition. In case I add a new slave, a BGSAVE is started, which uses a lot of I/O. Therefore I thought I could just put the base dir on a different disk, so that AOF fsyncs don't get horrible slow when a dump is happening.

I'm not sure how easy it would be to support AOF and base dir on different disks. If this is unwanted or too hard to implement, Redis should at least check on startup if base dir and AOF log are on the same disk, maybe by trying a rename() and stopping if it fails.