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

controlled indexing after migration #288

Merged
merged 3 commits into from
Oct 18, 2024
Merged

Conversation

LexLuthr
Copy link
Contributor

This PR makes the following changes to the market migration.

  1. The indexing tasks are no longer created directly.
  2. All info is captured in a table market_mk12_deal_pipeline_migration
  3. A migration function is called every 30 seconds by market poller to migrate data from this table to mk12_pipeline table which in turn creates indexing tasks along with IPNI if required.
  4. The function has following logic:
    • Step 1: Check if the migration table has entries
    • Step 2: Count entries ready for indexing in the pipeline table
    • Step 3: Count pending IPNI tasks
    • Calculate how many entries we need to reach 16
    • Calculate how many entries we can move without exceeding 16 pending IPNI tasks
    • Limit by the number of entries available in the migration table
    • Move entries from the migration table to the pipeline table

Relevant changes in Boost will be done.

@LexLuthr LexLuthr requested a review from magik6k October 17, 2024 15:02
Copy link
Collaborator

@magik6k magik6k left a comment

Choose a reason for hiding this comment

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

This looks basically good, couple small nits, but this already should work

Comment on lines +100 to +102
if task.Complete {
return true, nil
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't quite understand what the purpose of this is. Just being careful around retry?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. Being extra careful.

tasks/indexing/task_ipni.go Outdated Show resolved Hide resolved
harmony/harmonydb/sql/20241017-market-mig-indexing.sql Outdated Show resolved Hide resolved
@LexLuthr LexLuthr merged commit dd3ecf1 into feat/market Oct 18, 2024
14 checks passed
@LexLuthr LexLuthr deleted the controlled-indexing branch October 18, 2024 10:50
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