flant / curator-opensearch

Curator for OpenSearch.
Other
75 stars 28 forks source link

restore report state fails #29

Closed eyalc10 closed 1 year ago

eyalc10 commented 1 year ago

Issue: action.yaml file, restore action, indices ['xxx*']

class Restore(object): ... report_state function

In order to fix the issue - I have added the following code before the "for" statement:


        for chunk in utils.chunk_index_list(self.expected_output):
            try:
                chunk_response = self.client.indices.recovery(index=chunk, human=True)
            except Exception as err:
                raise exceptions.CuratorException(
                    'Unable to obtain recovery information for specified indices. '
                    'Error: {0}'.format(err)
                )
            # This should address #962, where perhaps the cluster state hasn't yet
            # had a chance to add a _recovery state yet, so it comes back empty.
            if chunk_response == {}:
                self.loggit.info('_recovery returned an empty response. Trying again.')
                return False
            response.update(chunk_response)
            self.loggit.info('eyalc: report_state Found indices: {0}'.format(list(response.keys())))

        self.expected_output = response.keys()
victorswed commented 1 year ago

+1

uzhinskiy commented 1 year ago

@eyalc10 : Hello.

  1. Please provide me a complete action.yaml and outputs of /_cat/indices and _cat/snapshots/repo-name/
  2. Can you prepare a PR with your changes?
uzhinskiy commented 1 year ago

Fixed in https://github.com/flant/curator-opensearch/pull/30