Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync and blank state DB can produce errors #7504

Open
daneryl opened this issue Nov 27, 2024 · 0 comments
Open

Sync and blank state DB can produce errors #7504

daneryl opened this issue Nov 27, 2024 · 0 comments

Comments

@daneryl
Copy link
Collaborator

daneryl commented Nov 27, 2024

Sync feature uses "_id" to match synced documents, when blank state is left not updated it can happen that there is a mismatch in "_id" for some documents, this happens because when blank state is not updated to the latest migration, the migrations are run and produce different _ids an easy example are the translations and this is why we had this kind of errors when trying to sync:

 "json": {
  "error": "E11000 duplicate key error collection: TENANT.translationsV2 index: language_1_key_1_context.id_1 dup key: { language: \"en\", key: \"% of sentences above threshold\", context.id: \"System\" }",
  "logLevel": "error",
  "prettyMessage": "E11000 duplicate key error collection: TENANT.translationsV2 index: language_1_key_1_context.id_1 dup key: { language: \"en\", key: \"% of sentences above threshold\", context.id: \"System\" }",
  "requestId": 7304
 },

the two instances have the same document but with different _ids, sync understands this as a different document but translations has a different unique _id set.

A workaround for this is to delete all translations from the target DB and let sync recreate the translations.

i did update the blank state to lower the chance of this happening in the near future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant