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

add copy_settings=true to url params #1379

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions curator/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2043,6 +2043,10 @@ def __init__(self, ilo, shrink_node='DETERMINISTIC', node_filters={},
if extra_settings:
self._merge_extra_settings(extra_settings)

self.shrink_copy_settings = {'copy_settings': 'true'}
if utils.get_version(self.client) < (6,4,3):
self.shrink_copy_settings = ''

def _merge_extra_settings(self, extra_settings):
self.loggit.debug(
'Adding extra_settings to shrink body: '
Expand Down Expand Up @@ -2304,7 +2308,14 @@ def do_action(self):
# Do the shrink
self.loggit.info('Shrinking index "{0}" to "{1}" with settings: {2}, wait_for_active_shards={3}'.format(idx, target, self.body, self.wait_for_active_shards))
try:
self.client.indices.shrink(index=idx, target=target, body=self.body, wait_for_active_shards=self.wait_for_active_shards)


self.client.indices.shrink(index=idx, params=self.shrink_copy_settings, target=target, body=self.body, wait_for_active_shards=self.wait_for_active_shards)
if utils.get_version(self.client) >= (6,4,3):
self.loggit.debug('unblocking writes on {0}'.format(target))
self._unblock_writes(target)
self.loggit.debug('undoing route reqs for {0}'.format(target))
self.route_index(target, 'require', '_name', '')
# Wait for it to complete
if self.wfc:
self.loggit.debug('Wait for shards to complete allocation for index: {0}'.format(target))
Expand Down Expand Up @@ -2341,4 +2352,3 @@ def do_action(self):
# Just in case it fails after attempting to meet this condition
self._unblock_writes(idx)
utils.report_failure(e)