Skip to content

Improve printed output from elasticgraph-admin #766

@myronmarston

Description

@myronmarston

The elasticgraph-admin gem provides two rake tasks:

  • clusters:configure:dry_run prints what would be updated in datastore clusters
  • clusters:configure:perform updates the datastore clusters and prints what it did

The output is not very user-friendly and is often quite confusing. It's primarily based on a diff of the "current" vs "desired" index configuration (mappings + settings). Some of the issues include:

  • When an index is being created for the first time, the output displays a diff of the ENTIRE index configuration which is super verbose, not very useful, and not formatted very well.
    • Instead, we should just say the index will be created. No need to diff in this case at all.
  • Elasticsearch/OpenSearch provide no API to drop old fields from an index mapping. Instead, you simply stop using it, and later when you prepare to run a backfill into a fresh index, the field will be omitted from the created index. However, the diff output shows the removed fields every time the admin tasks runs, which is very confusing. There's a note printed about them, but that frankly just adds to the verbosity and confusion of the output.
    • Instead, we should treat settings and mappings differently (we use separate calls to update the mappings and settings anyway!):
      • For mappings, we should only show new fields, since we can't remove dropped fields anyway.
      • For settings, we should show a full diff (since settings can be added and removed).

Also, when someone works on this, feel free to improve the output in any other ways you can think of :).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions