Skip to content

Conversation

rkistner
Copy link
Contributor

Builds on #121.

1. Initial snapshot

Previously, we used {snapshot: true} to replicate an initial snapshot. That gives nice consistency guarantees, but cannot run longer than 5 minutes (configurable using minSnapshotHistoryWindowInSeconds). So this caused replication of larger amounts of data to fail.

This fixes it to not use the snapshot mode anymore, but rather just make sure we replicate all incremental changes since the start of the snapshot. This means data modified during the snapshot may be replicated twice, but that should not cause any consistency issues.

2. Error recovery

Replication errors are only cleared once we successfully replicate some data (when .commit(lsn) is called). Development instances are often mostly idle, which meant that if some transient error ever occurred, it could take a long time before the error is cleared from the dashboard.

This fixes it to create an internal checkpoint whenever we start replication, which will trigger at least one commit() (as long as replication is working), clearing the error.

@changeset-bot
Copy link

changeset-bot bot commented Nov 12, 2024

⚠️ No Changeset found

Latest commit: 00af63e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Rentacookie
Rentacookie previously approved these changes Nov 12, 2024
Base automatically changed from mongodb-postimages to feat/modular-replication-architecture November 13, 2024 12:11
@rkistner rkistner dismissed Rentacookie’s stale review November 13, 2024 12:11

The base branch was changed.

@rkistner rkistner requested a review from Rentacookie November 13, 2024 12:13
@rkistner rkistner merged commit 91af7db into feat/modular-replication-architecture Nov 13, 2024
15 checks passed
@rkistner rkistner deleted the mongodb-fixes branch November 13, 2024 12:46
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