[Xapian-discuss] swapping database mid replication

Wes Chow
Fri, 04 Mar 2011 18:19:43 -0000

The Xapian documentation talks about a situation where you don't want to
do two database swaps while in the process of replicating. It says...

To confuse the replication system, the following needs to happen:

1. Start with two databases, A and B.
2. Start a replication of database A.
3. While the replication is in progress, swap B in place of A (ie, by
moving the files around, such that B is now at the path of A).
4. While the replication is still in progress, swap A back in place of B.

What if we omit step #4? Does that mess up replication on the client as
well? Specifically, the situation I'm thinking of is this:

1. Start with database A
2. Start replication of database A.
3. Compact A to B.
4. While replication is in progress: mv A A.orig && mv B A

How does this impact the replicating client? Do queries on the client
during the replication act on A, or some meld of A and B?


Thanks,
Wes

--