Skip to content

Commit f834364

Browse files
committed
Use transient settings instead of index specific ones
1 parent 6662805 commit f834364

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

share/github-backup-utils/ghe-backup-es-rsync

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,6 @@ if [ -d "$GHE_DATA_DIR/current/elasticsearch" ]; then
3939
link_dest="--link-dest=../../current/elasticsearch"
4040
fi
4141

42-
# Store the existing flush_threshold_size setting if it exists and if does not set it to ES default
43-
current_threshold=$(ghe-ssh "$host" -- curl -s "localhost:9200/_settings" | jq -r '.[].settings.index.translog.flush_threshold_size')
44-
if [ -z "$current_threshold" ]; then
45-
current_threshold="512MB"
46-
fi
47-
4842
# Transfer ES indices from a GitHub instance to the current snapshot
4943
# directory, using a previous snapshot to avoid transferring files that have
5044
# already been transferred.
@@ -60,15 +54,15 @@ log_rsync "END elasticsearch rsync" 1>&3
6054
# Set up a trap to re-enable flushing on exit and remove temp file
6155
cleanup () {
6256
ghe_verbose "* Enabling ES index flushing ..."
63-
echo "{\"index\":{\"translog.flush_threshold_size\":\"$current_threshold\"}}" |
57+
echo '{"transient":{"index.translog.flush_threshold_size":null}}' |
6458
ghe-ssh "$host" -- curl -s -XPUT "localhost:9200/_settings" -d @- >/dev/null
6559
}
6660
trap 'cleanup' EXIT
6761
trap 'exit $?' INT # ^C always terminate
6862

6963
# Disable ES flushing and force a flush right now
7064
ghe_verbose "* Disabling ES index flushing ..."
71-
echo '{"index":{"translog.flush_threshold_size":"1PB"}}' |
65+
echo '{"transient":{"index.translog.flush_threshold_size":"1PB"}}' |
7266
ghe-ssh "$host" -- curl -s -XPUT "localhost:9200/_settings" -d @- >/dev/null
7367
ghe-ssh "$host" -- curl -s -XPOST "localhost:9200/_flush" >/dev/null
7468

0 commit comments

Comments
 (0)