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

feat(index): full sync operations #11178

Merged
merged 59 commits into from
Feb 5, 2025
Merged

feat(index): full sync operations #11178

merged 59 commits into from
Feb 5, 2025

Conversation

adrien2p
Copy link
Member

@adrien2p adrien2p commented Jan 27, 2025

Closes: FRMW-2892, FRMW-2893

What
Wired up the building block that we merged previously in order to manage data synchronization. The flow is as follow

  • On application start
    • Build schema object representation from configuration
    • Check configuration changes
      • if new entities configured
        • Data synchronizer initialize orchestrator and start sync
          • for each entity
            • acquire lock
            • mark existing data as staled
            • sync all data by batch
            • marked them not staled anymore
            • acknowledge each processed batch and renew lock
            • update metadata with last synced cursor for entity X
            • release lock
        • remove all remaining staled data
      • if any entities removed from last configuration
        • remove the index data and relations

Copy link

vercel bot commented Jan 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api-reference 🔄 Building (Inspect) Visit Preview 💬 Add feedback Feb 5, 2025 1:14pm
medusa-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 5, 2025 1:14pm
5 Skipped Deployments
Name Status Preview Comments Updated (UTC)
api-reference-v2 ⬜️ Ignored (Inspect) Visit Preview Feb 5, 2025 1:14pm
docs-ui ⬜️ Ignored (Inspect) Visit Preview Feb 5, 2025 1:14pm
docs-v2 ⬜️ Ignored (Inspect) Visit Preview Feb 5, 2025 1:14pm
medusa-docs ⬜️ Ignored (Inspect) Visit Preview Feb 5, 2025 1:14pm
resources-docs ⬜️ Ignored (Inspect) Visit Preview Feb 5, 2025 1:14pm

Copy link

changeset-bot bot commented Jan 27, 2025

🦋 Changeset detected

Latest commit: 04fad73

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 65 packages
Name Type
@medusajs/modules-sdk Patch
@medusajs/index Patch
@medusajs/utils Patch
integration-tests-http Patch
@medusajs/cli Patch
@medusajs/medusa Patch
@medusajs/test-utils Patch
@medusajs/api-key Patch
@medusajs/auth Patch
@medusajs/cache-inmemory Patch
@medusajs/cache-redis Patch
@medusajs/cart Patch
@medusajs/currency Patch
@medusajs/customer Patch
@medusajs/event-bus-local Patch
@medusajs/event-bus-redis Patch
@medusajs/file Patch
@medusajs/fulfillment Patch
@medusajs/inventory Patch
@medusajs/link-modules Patch
@medusajs/locking Patch
@medusajs/notification Patch
@medusajs/order Patch
@medusajs/payment Patch
@medusajs/pricing Patch
@medusajs/product Patch
@medusajs/promotion Patch
@medusajs/region Patch
@medusajs/sales-channel Patch
@medusajs/stock-location Patch
@medusajs/store Patch
@medusajs/tax Patch
@medusajs/user Patch
@medusajs/workflow-engine-inmemory Patch
@medusajs/workflow-engine-redis Patch
@medusajs/auth-emailpass Patch
@medusajs/auth-github Patch
@medusajs/auth-google Patch
@medusajs/file-local Patch
@medusajs/file-s3 Patch
@medusajs/fulfillment-manual Patch
@medusajs/locking-postgres Patch
@medusajs/locking-redis Patch
@medusajs/notification-local Patch
@medusajs/notification-sendgrid Patch
@medusajs/payment-stripe Patch
@medusajs/core-flows Patch
@medusajs/framework Patch
@medusajs/js-sdk Patch
@medusajs/orchestration Patch
@medusajs/types Patch
@medusajs/workflows-sdk Patch
@medusajs/medusa-oas-cli Patch
@medusajs/oas-github-ci Patch
@medusajs/telemetry Patch
@medusajs/admin-bundler Patch
@medusajs/admin-sdk Patch
@medusajs/admin-shared Patch
@medusajs/admin-vite-plugin Patch
@medusajs/dashboard Patch
@medusajs/icons Patch
@medusajs/toolbox Patch
@medusajs/ui-preset Patch
create-medusa-app Patch
medusa-dev-cli Patch

Not sure what this means? Click here to learn what changesets are.

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

@carlos-r-l-rodrigues
Copy link
Contributor

@olivermrbl this is ready to review, and it would be good to test a snapshot of it somewhere. Ideally in an existing Database with data.

Copy link
Contributor

Will do!

@olivermrbl
Copy link
Contributor

/snapshot-this

Copy link
Contributor

github-actions bot commented Feb 3, 2025

🚀 A snapshot release has been made for this PR

Test the snapshots by updating your package.json with the newly published versions:

yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]

Latest commit: 178a7f4

Copy link
Contributor

@olivermrbl olivermrbl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Ran a few tests against a local DB. Initial sync, adding, updating, and deleting resources from the index all seem to work as expected. Anything else I should try?

@carlos-r-l-rodrigues
Copy link
Contributor

carlos-r-l-rodrigues commented Feb 5, 2025

Nice! Ran a few tests against a local DB. Initial sync, adding, updating, and deleting resources from the index all seem to work as expected. Anything else I should try?

It seems that you covered all the features. That's it.
Thanks Oli

I'm merging it as there is a bug fix on the internal medusa service to update/delete entries.

@kodiakhq kodiakhq bot merged commit a33aebd into develop Feb 5, 2025
23 checks passed
@kodiakhq kodiakhq bot deleted the feat/index-sync-wired branch February 5, 2025 16:49
@github-actions github-actions bot mentioned this pull request Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants