Keep current sync rule storage active when restarting replication due to errors #216
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are some scenarios that trigger a restart of replication:
In those cases, replication is restarted by creating a new sync-rules copy. The issue is that the active storage was immediately stopped, which could result in an unexpected
[PSYNC_S2302] No sync rules availableerror.This change instead keeps the current sync-rules storage active, which will be stopped automatically once the new storage has finished initial replication. This means clients can still continue syncing the (stale) data while re-replicating.
To implement this, a new
ERROREDstate is introduced for sync rules. This is the same as ACTIVE in terms of serving sync requests, but is not replicated.This fixes some other issues:
storageCreatedhooks. Those caused issues in some cases if the sync rules had a parse error.