Skip to content

AO3-7283 Configurable number of shards for pseuds and tags index#5590

Open
not-varram wants to merge 1 commit intootwcode:masterfrom
not-varram:AO3-7283
Open

AO3-7283 Configurable number of shards for pseuds and tags index#5590
not-varram wants to merge 1 commit intootwcode:masterfrom
not-varram:AO3-7283

Conversation

@not-varram
Copy link
Contributor

Pull Request Checklist

Purpose

Adds TAGS_SHARDS and PSEUDS_SHARDS config values and uses them when recreating tag and pseud search indexes.

Testing Instructions

  • docker compose run --rm test bundle exec rspec spec/models/search/pseud_indexer_spec.rb spec/models/search/tag_indexer_spec.rb spec/lib/tasks/search_tasks.rake_spec.rb

  • docker compose run --rm web bundle exec rake search:index_pseuds

  • docker compose run --rm web bundle exec rake search:index_tags

    Expected: all pass with no errors.

Or just run it and ensure it builds :)

Credit

not-varram (he/him)

@Bilka2 Bilka2 changed the title AO3-7283-Configurable-number-of-shards-for-pseuds and-tags-index AO3-7283 Configurable number of shards for pseuds and tags index Feb 17, 2026
Copy link
Contributor

@Bilka2 Bilka2 left a comment

Choose a reason for hiding this comment

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

Thank you for working on this, just some nitpicks with the tests!

Also, could you please link the Jira issue in the description of your PR

Comment on lines +790 to +791
PSEUDS_SHARDS: 5
TAGS_SHARDS: 5
Copy link
Contributor

Choose a reason for hiding this comment

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

these should be PSEUD_SHARDS and TAG_SHARDS please, to match the naming of the indexer classes

PSEUDS_SHARDS: 5
TAGS_SHARDS: 5
WORKS_SHARDS: 5
USER_SHARDS: 5
Copy link
Contributor

Choose a reason for hiding this comment

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

can you reorder this one to be alphabetical as well while you're here?


describe PseudIndexer, pseud_search: true do
describe ".index_all" do
it "uses configured shard count when creating the index" do
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you work with expect(...).to receive here instead of the allow and have_received combination? to receive is much more common in our test suite so it'd be nice to stick to that established style. Same for the other test

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.

2 participants