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

Audit CLI Script #172

Open
kevinfodness opened this issue Nov 28, 2023 · 1 comment
Open

Audit CLI Script #172

kevinfodness opened this issue Nov 28, 2023 · 1 comment
Labels
elasticsearch Requires understanding Elasticsearch enhancement New feature or request php Requires understanding PHP

Comments

@kevinfodness
Copy link
Member

Description

Anecdotally, we've had some trouble running the index command on Pantheon via Terminus when using Elastic Cloud on 8.x. Symptoms include:

  1. Timeouts. We're hitting 10s timeouts when attempting to do things like flush the index or put the mapping. Unclear where this is coming from.
  2. Failures to flush or put the mapping. Perhaps flush is failing if the index is already empty or doesn't exist? Perhaps a different cause?
  3. Intermittent failures to bulk index, which could be related to timeouts or could be a separate issue entirely.

We need to audit the CLI script for indexing, including the options for flushing and putting the mapping, to make it more reliable.

Use Case

As a developer, I want to be able to reindex a site using the CLI including flushing the old index and putting the mapping without encountering errors.

@kevinfodness kevinfodness added enhancement New feature or request php Requires understanding PHP elasticsearch Requires understanding Elasticsearch labels Nov 28, 2023
@mboynes
Copy link
Contributor

mboynes commented Nov 28, 2023

Additional notes/ideas:

  • Improve error handling and reporting. If a post fails, identify which one(s) failed and try to figure out why.
  • Automatic retries and self-adjustment. If a request times out, split the batch in two and try again. Repeat n times.
  • Add a progress bar. Maybe leverage https://github.com/alleyinteractive/wp-bulk-task?
    • If we don't leverage WP Bulk Task, then ensure that the CLI script is cursoring through content instead of paginating through it.
  • When running the index command, automatically --put-mapping if --flush is included. I don't think there's a circumstance where we'd want to flush without adding the mapping, so that begs for trouble. Alternatively, we could include an option to --skip-mapping if there was a reason (I don't think it's necessary; decisions over options)
  • Add some additional basic commands to interact with ES, e.g. get a post, run a search, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
elasticsearch Requires understanding Elasticsearch enhancement New feature or request php Requires understanding PHP
Projects
None yet
Development

No branches or pull requests

2 participants