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
EMQX-11319 data backup http api #12017
EMQX-11319 data backup http api #12017
Conversation
e9fc99b
to
eae6037
Compare
eae6037
to
e820ec8
Compare
723db0b
to
9998c06
Compare
9998c06
to
89fdbf3
Compare
FileNode -> | ||
CoreNode = core_node(FileNode), | ||
response( | ||
emqx_mgmt_data_backup_proto_v1:import_file(CoreNode, FileNode, FileName, infinity) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only core node is allowed to import a backup, because it implies using mnesia:restore/2
. Calling it on a replicant node would mean that Mnesia data is only restored locally.
|
||
list_backup_files(Page, Limit) -> | ||
Start = Page * Limit - Limit + 1, | ||
lists:sublist(list_backup_files(), Start, Limit). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naive paging, but I think the number of stored backup files is not expected to be very large...
Additionally, this simply lists *.tar.gz
files in <emqx data dir>/backup
. Adding some Mnesia DB layer for backups is possible but it would be hard to keep it in sync with FS state, especially taking into account the fact that users can directly manage backup
dir without the dashboard..
Fixes
PR Checklist
Please convert it to a draft if any of the following conditions are not met. Reviewers may skip over until all the items are checked:
changes/(ce|ee)/(feat|perf|fix|breaking)-<PR-id>.en.md
filesChecklist for CI (.github/workflows) changes
changes/
dir for user-facing artifacts update