docs(15.9): restore configsync first so a snapshot restore brings the dictionaries back - #542
Merged
Merged
Conversation
… dictionaries back
The index backup page could not be followed to move Fess to a new
OpenSearch. Its "restore all indexes" example ("indices": "*") fails on
any fresh node, because the configsync plugin creates its own configsync
index at startup and a restore refuses an open index of the same name.
Restoring fess* instead leaves the cluster red: the search index and
fess_suggest_analyzer name dictionary files under OpenSearch's
config/dictionary, a snapshot carries the settings but not the files,
and the shards fail with "IOException while reading mappings_path: file
not readable". Fess started against that cluster fails to initialize
and answers 404 on every page.
The dictionaries live in the configsync index, which the plugin writes
out to config/dictionary. The restore now brings configsync back first,
writes the files with _configsync/flush, and only then restores fess*,
waiting for the cluster to leave red before Fess is started. The
fess-only backup example includes configsync, and the index table says
why it matters.
A new troubleshooting entry covers a cluster that is already red. Copying
the dictionary files and running _cluster/reroute?retry_failed=true does
not recover it: a shard whose restore failed is not allocated again until
its index is closed or deleted and restored once more. The entry closes
the red indexes and restores them again after the files are back.
All seven languages, 15.9 tree only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
config/admin-index-backup.rstcannot be followed to move Fess onto a new OpenSearch. This has been the case since 15.8. It fails in three ways:"indices": "*") fails outright on a fresh node. The configsync plugin creates its ownconfigsyncindex at startup, so the restore stops withcannot restore index [configsync] because an open index with same name already exists in the cluster.fess*instead leaves the cluster red. The search index andfess_suggest_analyzername dictionary files under OpenSearch'sconfig/dictionary(mappings_path,keywords_path, ...). A snapshot carries those settings but not the files, so 6 shards fail withIOException while reading mappings_path: file not readable.Failed to initialize Lasta Di(aNullPointerExceptioninSuggestHelper#init) is logged and every request returns 404.The obvious repair does not work either. Copying the dictionary files onto the new node and running
_cluster/reroute?retry_failed=trueleaves the cluster red._cluster/allocation/explaingives the reason:restore_in_progressrefuses a shard whose restore failed "until the index is closed or deleted" and restored again.What changes
The dictionaries are stored in the
configsyncindex, which the plugin writes out toconfig/dictionary. The restore now runs in that order:configsyncthat the plugin created, then restoreconfigsyncfrom the snapshot.POST _configsync/flushto write the files. It rewrites every stored file that is missing or older on disk.fess*.Other changes:
configsyncrow, plus a warning that a snapshot contains no dictionary files."fess*,configsync". Afess*-only snapshot cannot bring the dictionaries back.retry_faileddoes not help, and the recovery. The recovery is to restoreconfigsyncand flush, then close the red indexes and restore them again.This is done for all seven languages, in the 15.9 tree only.
Verification
I used Docker with
ghcr.io/codelibs/fess-opensearch:3.8.0and a Fess 15.9.0-SNAPSHOT ZIP built frommain.Source. I set up host A with three documents, a new admin user, a web crawl config and
day_for_cleanup=7saved in General. I also added a custom synonym entry through the dictionary admin API. I took a snapshot as the page shows and backed up the config files it lists. Then I stopped A.Before (the page as it is). Host B had a new OpenSearch sharing the repository and a newly unpacked ZIP with the config files copied in.
"indices": "*"cannot restore index [configsync] because an open index with same name already existsfess*red, 6 unassigned (fess.<timestamp>,fess_suggest_analyzer),IOException while reading keywords_path: file not readableFailed to initialize Lasta Di(NPE inSuggestHelper#init), every request 404reroute?retry_failed=truered/ 6 unassigned; therestore_in_progressdecider refusesAfter (the commands extracted from the new ja page and run as written). Each run used a fresh OpenSearch and a fresh Fess on B.
snapshot_1("*")green, 0 unassignedsnapshot_fess_only("fess*,configsync")greenIn both runs the restored Fess returned the same results as the source for everything checked:
day_for_cleanup=7synonym.txton diskThe user created before the backup logs in with the same password.
Also verified:
configsync, flush,retry_failed(still red), then close and restore the two red indexes, after which the cluster is green.fess*/_closeon a running cluster, the same steps restore all 58 shards and the cluster is green.All seven changed files were parsed with docutils and compared against
main:|Fess|).::blocks, which is the page's existing style.