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

get_total_objects_for_query_from_db(): bail if we have any limits set #2586

Merged
merged 2 commits into from
Feb 7, 2022
Merged

get_total_objects_for_query_from_db(): bail if we have any limits set #2586

merged 2 commits into from
Feb 7, 2022

Conversation

rebeccahum
Copy link
Contributor

Description of the Change

Slight continuation from #2571. We should bail if ep_indexing_lower_limit_object_id or ep_indexing_upper_limit_object_id is set since we're only looking for the total count from the DB and there's no way to determine that based on the object ID limits.

Alternate Designs

N/A.

Possible Drawbacks

It will return a 0, so doesn't exactly fix the initial problem if we run into that with the limit ids.

Verification Process

On a yuge site where it kills the found_posts in get_total_objects_for_query(), pass in --upper-limit-object-id and expect it to return 0 instead of an inaccurate number.

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Changelog Entry

Fixed: Do not count posts in get_total_objects_for_query_from_db() if any object limit IDs are passed in

Credits

Props @rebeccahum

@felipeelia felipeelia merged commit da94959 into 10up:develop Feb 7, 2022
@rebeccahum rebeccahum deleted the fix/get_total_objects_for_query_ep_indexing_upper_limit_object_id branch February 7, 2022 17:44
rebeccahum added a commit to Automattic/ElasticPress that referenced this pull request Feb 7, 2022
rebeccahum added a commit to Automattic/ElasticPress that referenced this pull request Feb 7, 2022
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