Automattic / vip-cli

The VIP CLI
https://docs.wpvip.com/vip-cli/
MIT License
58 stars 16 forks source link

`vip @example.env -- wp vip-search index-versions list term` returns document_count = 0 intermittently for fresh Version 2 #1961

Open NinjutsuSunrise opened 1 month ago

NinjutsuSunrise commented 1 month ago

Expected/Desired Behavior

After running vip @example.env -- wp vip-search index --indexables="term" --version="next" the document_count for Version 2 of the Index should be accurate via vip @example.env -- wp vip-search index-versions list term.

Actual Behavior

After running vip @example.env -- wp vip-search index --indexables="term" --version="next" the document_count for Version 2 of the Index is intermittently 0 via vip @example.env -- wp vip-search index-versions list term. First 0, then 253681, then 0, then 253681 and staying consistent after some time.

As an aside, vip @example.env -- wp vip-search health validate-terms-count was always accurate. Still, the buggy document_count introduces confusion and doubt.

Note: vip -v = 3.7.0

Steps to Reproduce the Problem

  1. vip @example.env -- wp vip-search index --indexables="term" --version="next"
  2. vip @example.env -- wp vip-search index-versions list term (was 0)
  3. vip @example.env -- wp vip-search index-versions list term (was 253681)
  4. vip @example.env -- wp vip-search health validate-terms-count (no problem)
  5. vip @example.env -- wp vip-search index-versions list term (was 0)
  6. vip @example.env -- wp vip-search index-versions list term (was 253681)
sjinks commented 1 month ago

This probably belongs to https://github.com/Automattic/vip-go-mu-plugins

cc @rebeccahum @rinatkhaziev

rebeccahum commented 1 month ago

Hmm I can't seem to reproduce. The only thing that comes to mind is if the ES request fails (which is why it's intermittently happening): https://github.com/Automattic/vip-go-mu-plugins/blob/44e6293555331be77646e30ee2df97c961fcd34c/search/includes/classes/class-health.php#L1168