Merge pull request #433 from github/enterprise-3.6-backport-378-fix-es-translog-setting

Backport 378 for 3.6: Replace deprecated translog flush setting in ES
This commit is contained in:
Chuck Pathanjali 2023-08-07 09:56:43 -04:00 коммит произвёл GitHub
Родитель 54fafea212 f3b141d5a6
Коммит 7a9d4b67c4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -4,6 +4,7 @@
#/
#/ Note: This command typically isn't called directly. It's invoked by
#/ ghe-backup when the rsync strategy is used.
# shellcheck disable=SC2086
set -e
# Bring in the backup configuration
@ -53,7 +54,7 @@ ghe-rsync -avz \
# Set up a trap to re-enable flushing on exit and remove temp file
cleanup () {
ghe_verbose "* Enabling ES index flushing ..."
echo '{"index":{"translog.disable_flush":false}}' |
echo '{"index":{"translog.flush_threshold_size":"512MB"}}' |
ghe-ssh "$host" -- curl -s -XPUT "localhost:9200/_settings" -d @- >/dev/null
}
trap 'cleanup' EXIT
@ -61,7 +62,7 @@ trap 'exit $?' INT # ^C always terminate
# Disable ES flushing and force a flush right now
ghe_verbose "* Disabling ES index flushing ..."
echo '{"index":{"translog.disable_flush":true}}' |
echo '{"index":{"translog.flush_threshold_size":"1PB"}}' |
ghe-ssh "$host" -- curl -s -XPUT "localhost:9200/_settings" -d @- >/dev/null
ghe-ssh "$host" -- curl -s -XPOST "localhost:9200/_flush" >/dev/null