Skip to content
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

Merged

Conversation

SergeTupchiy
Copy link
Contributor

@SergeTupchiy SergeTupchiy commented Nov 23, 2023

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:

  • Added tests for the changes
  • Added property-based tests for code which performs user input validation
  • Changed lines covered in coverage report
  • Change log has been added to changes/(ce|ee)/(feat|perf|fix|breaking)-<PR-id>.en.md files
  • For internal contributor: there is a jira ticket to track this change
  • Created PR to emqx-docs if documentation update is required, or link to a follow-up jira ticket
  • Schema changes are backward compatible

Checklist for CI (.github/workflows) changes

  • If changed package build workflow, pass this action (manual trigger)
  • Change log has been added to changes/ dir for user-facing artifacts update

@SergeTupchiy SergeTupchiy changed the base branch from master to release-54 November 23, 2023 21:13
@SergeTupchiy SergeTupchiy changed the title Emqx 11319 data backup http api EMQX-11319 data backup http api Nov 23, 2023
@SergeTupchiy SergeTupchiy marked this pull request as ready for review November 24, 2023 19:43
@SergeTupchiy SergeTupchiy force-pushed the EMQX-11319-data-backup-http-api branch 2 times, most recently from 723db0b to 9998c06 Compare November 27, 2023 14:19
FileNode ->
CoreNode = core_node(FileNode),
response(
emqx_mgmt_data_backup_proto_v1:import_file(CoreNode, FileNode, FileName, infinity)
Copy link
Contributor Author

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).
Copy link
Contributor Author

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..

@SergeTupchiy SergeTupchiy merged commit 3b1ae0f into emqx:release-54 Nov 27, 2023
163 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants