Skip to content
This repository was archived by the owner on Sep 19, 2019. It is now read-only.

12274 - Reduce sync delay for small databases#2

Merged
kocolosk merged 3 commits into
masterfrom
12274-sync-improvements
Jun 27, 2011
Merged

12274 - Reduce sync delay for small databases#2
kocolosk merged 3 commits into
masterfrom
12274-sync-improvements

Conversation

@kocolosk

Copy link
Copy Markdown
Contributor

It's a little hacky, but I think the end result is positive. The idea is to replicate at most 100 updates to a database shard at a time, then move on to the next shard in the queue. If the shard has pending changes waiting to be synced it gets re-inserted into the waiting queue. I also refactored the internal data structures in mem3_sync so that we could track the total number of pending changes (i.e., the backlog) as the server reaches a steady state.

A alternative design might be to have mem3_rep return {ok, PendingChanges} every time, and make that sure that PendingChanges always bubbles up to the sync server. Current approach is to exit(normal) when PendingChanges == 0. We could also make the batch size (100) and the number of batches (1) configurable, though I don't see an immediate need for it. The batch size is kept small at the moment so that the replicator makes progress even on heavily loaded shards.

kocolosk added 3 commits June 9, 2011 13:44
If the replication completes in this batch, the process will exit
normally.  If not, the reason will be {pending_changes, N} and will
be logged at 'warn' level.  mem3_sync will then push the replication
back into the queue.

BugzID: 12274
@kocolosk kocolosk merged commit 7a2b66f into master Jun 27, 2011
smithsz pushed a commit that referenced this pull request Feb 11, 2015
- Remove the ability to set batch_count 'all'
- Add an additional go/1 clause to handle batch_size = 0 case
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant