Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Restore of Elasticsearch indexes in json form is inoperable on standalone nodes #457
Comments
|
Nice catch with the version comparison... I suspect I may have missed something, somewhere as I'm pretty sure this did work correctly when I implemented it. That said, as things stand, neither condition would be true so the JSON dumps won't be restored on single nodes so this is working as you would like by pure luck |
|
I've just checked and the version string should not have the Here's what I get when when I test this against 2.15:
The first line is what is used for the |
I've only just seen this update. So are you saying this isn't really a problem now? |
|
We're using the output of backup-utils/share/github-backup-utils/ghe-backup-config Lines 224 to 241 in e3d5053
backup-utils/bin/ghe-host-check Line 129 in e3d5053 Example:
This Line 264 in e3d5053 which doesn't deal with backup-utils/share/github-backup-utils/ghe-backup-config Lines 304 to 306 in e3d5053 |
From my cursory reading it looks like even if we were to copy the compressed json files correctly to the appliance, the files would never be loaded into Elasticsearch. |
Oh yes. Not sure why I thought it was from |
I've looked into this and once the version issue has been resolved, yes, the JSON files are loaded because they're loaded as part of the restore process itself, for example here for audit logs: backup-utils/share/github-backup-utils/ghe-restore-es-audit-log Lines 61 to 68 in e3d5053 But you're also right in that this is a bit pointless as they'll then be overwritten by exactly the same indices that have been transferred as part of... Lines 291 to 294 in e3d5053 ... when I'm sure I had a reason for this belt-and-braces approach at the time, but can't think of it right now. |
You are absolutely right, I blanked on the In any case, do you have any objections to removing the version check from Lines 303 to 309 in e3d5053 so that JSON dumps are only restored on cluster? If not, I can prepare a PR for that. |
Hold off for the moment. I want to try and remember why I implemented it in the first place.
Other than being a slight waste of time (assuming it worked - fix coming), what problems is this currently causing? |
|
We've got customers with GiB worth of audit logs due to earlier LDAP-sync over-logging, so for them I assume it will be a quite noticeable waste of time. Not sure how relevant it is in the context of complete restore time though. Hookshot indexes can also be hefty for active appliances. There's also the topic of correctness, we do some validation that the JSON dumps match the index in question, but at the end of the day the |
The following code will not achieve the desired results for
tworeasonsbackup-utils/bin/ghe-restore
Lines 301 to 309 in e3d5053
Firstly, the version check fails due to the included
vin$GHE_REMOTE_VERSION:Secondly, the imports are run beforeghe-config-applyis triggered. This means that all imported data will be written to the ES data directory that is going to be overwritten on the nextghe-config-applyinvocation.On second reading, the import does not happen during the respectiveghe-restorescripts but duringghe-storage-prepare, so that should work.On third reading, the import will not happen because
ghe-storage-preparewill onlymv/data/user/elasticsearch-restoreto/data/user/elasticsearch. Importing of the json dumps happens inelasticsearch-post-start(systemdExecStartPostfor the elasticsearch unit) which only checks/data/user/elasticsearch-restore.Given that the data in the json dumps should be present in the
rsyncbackup anyhow I'm inclined to remove the json restore for standalone appliances. The additional json dumps are helpful when trying to recover from corrupted indexes but don't seem to provide any additional value during regular restores.Thoughts?