-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support to take parallel backups
- Loading branch information
Showing
18 changed files
with
545 additions
and
220 deletions.
There are no files selected for viewing
74 changes: 74 additions & 0 deletions
74
dev-support/design-docs/parallel-backup/existing_design.uml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
@startuml | ||
/' | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
'/ | ||
start | ||
: (1.1) Create Backup; | ||
if ( hasActiveSession or inInconsistentState?) then (yes) | ||
: Fail; | ||
stop | ||
else (no) | ||
: (1.2.1) Create Backup Request and execute; | ||
: (1.2.2) Create dirs in destination; | ||
: (1.2.3) Create Backup Client and execute; | ||
: (1.2.4) Create exclusive backup session; | ||
: (1.2.5) Take Backup Table Snapshot; | ||
: (1.2.6) Set State to RUNNING and phase to REQUEST; | ||
if ( full backup?) then (yes) | ||
: (1.2.7.1.1) Read last backup start time or 0L; | ||
: (1.2.7.1.2) Perform LogRoll Procedure; | ||
: (1.2.7.1.3) Record WAL older than LogRoll to system table; | ||
: (1.2.7.1.4) Set Phase to SNAPSHOT; | ||
: (1.2.7.1.5) Take Snapshot of every table; | ||
: (1.2.7.1.6) Export Snapshot to dest dir; | ||
: (1.2.7.1.7) Write start time for next backup to system table; | ||
: (1.2.7.1.8) Add Manifest; | ||
: (1.2.7.1.9) Delete Snapshots; | ||
: (1.2.7.1.10) Cleanup Export snapshot log; | ||
else (no) | ||
: (1.2.7.2.1) Set phase to PREPARE_INCREMENTAL; | ||
if (fail to get log file map?) then (yes) | ||
: Fail; | ||
stop | ||
else (no) | ||
: (1.2.7.2.2) Copy table and region info; | ||
: (1.2.7.2.3) MR to convert WAL into HFiles; | ||
: (1.2.7.2.4) Copy HFiles into dest with DistCP | ||
: (1.2.7.2.5) Record WAL older than what is copied; | ||
: (1.2.7.2.6) Write start time for next backup to system table; | ||
: (1.2.7.2.7) Add Manifest; | ||
: (1.2.7.2.8) Cleanup DistCp log; | ||
endif | ||
endif | ||
: (1.2.8) Delete System Table Snapshot; | ||
: (1.2.9) Update BackupInfo with Status Complete; | ||
: (1.2.10) Clear exclusive backup sesion; | ||
endif | ||
stop | ||
|
||
start | ||
: Fail; | ||
: (2.1) Set State to FAILED; | ||
if (full backup?) then (yes) | ||
: (2.2.1.1) Delete all snapshots; | ||
: (2.2.1.2)Cleanup export snapshot log; | ||
endif | ||
: (2.3) Restore backup system table from snapshot; | ||
: (2.4) Delete backup system table snapshot; | ||
: (2.5) Cleanup Target Dir; | ||
stop | ||
@enduml |
76 changes: 76 additions & 0 deletions
76
dev-support/design-docs/parallel-backup/proposed_design.uml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
@startuml | ||
/' | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
'/ | ||
|
||
start | ||
: (1.1) Create Backup; | ||
: (1.2.1) Create Backup Request and execute; | ||
: (1.2.2) Create dirs in destination; | ||
: (1.2.3) Create Backup Client and execute; | ||
#Orange: (1.2.4) Create exclusive backup session; | ||
note right: Table exclusive lock | ||
#Red: (1.2.5) Take Backup Table Snapshot; | ||
note right: To be removed | ||
: (1.2.6) Set State to RUNNING and phase to REQUEST; | ||
if ( full backup?) then (yes) | ||
: (1.2.7.1.1) Read last backup start time or 0L; | ||
: (1.2.7.1.2) Perform LogRoll Procedure; | ||
: (1.2.7.1.3) Record WAL older than LogRoll to system table; | ||
: (1.2.7.1.4) Set Phase to SNAPSHOT; | ||
: (1.2.7.1.5) Take Snapshot of every table; | ||
: (1.2.7.1.6) Export Snapshot to dest dir; | ||
: (1.2.7.1.7) Write start time for next backup to system table; | ||
: (1.2.7.1.8) Add Manifest; | ||
: (1.2.7.1.9) Delete Snapshots; | ||
: (1.2.7.1.10) Cleanup Export snapshot log; | ||
else (no) | ||
: (1.2.7.2.1) Set phase to PREPARE_INCREMENTAL; | ||
if (fail to get log file map?) then (yes) | ||
: Fail; | ||
stop | ||
else (no) | ||
: (1.2.7.2.2) Copy table and region info; | ||
: (1.2.7.2.3) MR to convert WAL into HFiles; | ||
: (1.2.7.2.4) Copy HFiles into dest with DistCP | ||
: (1.2.7.2.5) Record WAL older than what is copied; | ||
: (1.2.7.2.6) Write start time for next backup to system table; | ||
: (1.2.7.2.7) Add Manifest; | ||
: (1.2.7.2.8) Cleanup DistCp log; | ||
endif | ||
endif | ||
#RED: (1.2.8) Delete System Table Snapshot; | ||
note right: To be removed | ||
: (1.2.9) Update BackupInfo with Status Complete; | ||
#Orange: (1.2.10) Clear exclusive backup sesion; | ||
note right: Clear table exclusive lock | ||
stop | ||
|
||
start | ||
: Fail; | ||
: (2.1) Set State to FAILED; | ||
if (full backup?) then (yes) | ||
: (2.2.1.1) Delete all snapshots; | ||
: (2.2.1.2) Cleanup export snapshot log; | ||
endif | ||
#RED: (2.3) Restore backup system table from snapshot; | ||
note right: To be removed | ||
#RED: (2.4) Delete backup system table snapshot; | ||
note right: To be removed | ||
: (2.5) Cleanup Target Dir; | ||
stop | ||
@enduml |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.