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

BUG: Index cleanup process - offset being zeroed too late #3764

Closed
pknap opened this issue Nov 15, 2023 · 0 comments · Fixed by #3765
Closed

BUG: Index cleanup process - offset being zeroed too late #3764

pknap opened this issue Nov 15, 2023 · 0 comments · Fixed by #3765
Milestone

Comments

@pknap
Copy link
Contributor

pknap commented Nov 15, 2023

I think that in indexer cleanup process (I am testing it with 4.7.2 version), offset resetting happens too late here:

$this->index_meta['offset'] = 0;

In case there are any errors during one indexable type indexing (in my case full reindex called from admin dashboard) it will try to output warning before resetting offset.

The problem is, that output method in the end calls wp_send_json which calls die() / wp_die() and effectively stops further execution. This means that offset will not be zeroed.

image

Then, when next indexable type indexing starts it picks up offset from where previous indexing finished. So for example when I had 1465 posts to index, terms will start indexing from offset 1465, which in my case leads to terms index being empty.

image

image

I believe that offset reset should be moved upper, probably right after $this->index_meta['current_sync_item'] = null;

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 a pull request may close this issue.

2 participants