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

when deleting a space, the snapshot of the space is also deleted #2460

Merged
merged 7 commits into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs-2.0/3.ngql-guide/9.space-statements/5.drop-space.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

!!! note

`DROP SPACE`是否删除图空间对应的硬盘数据由 Storage 配置参数 auto_remove_invalid_space 决定。auto_remove_invalid_space 的默认值为`true`,表示会删除数据。如需在删除逻辑图空间时保留硬盘数据,将 auto_remove_invalid_space 的值修改为`false`。详情参见 [Storage 服务配置](../../5.configurations-and-logs/1.configurations/4.storage-config.md)。
`DROP SPACE`是否删除图空间对应的硬盘数据由 Storage 配置参数`auto_remove_invalid_space`决定。`auto_remove_invalid_space`的默认值为`true`,表示会删除数据。如需在删除逻辑图空间时保留硬盘数据,将`auto_remove_invalid_space`的值修改为`false`。详情参见 [Storage 服务配置](../../5.configurations-and-logs/1.configurations/4.storage-config.md)。

!!! warning

执行`DROP SPACE`后,即使快照中存在该图空间的数据,该图空间的数据也无法恢复。当`auto_remove_invalid_space`的值为`false`时,不会出现此种情况。

## 前提条件

Expand Down
5 changes: 4 additions & 1 deletion docs-2.0/backup-and-restore/3.manage-snapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,12 @@ nebula> SHOW SNAPSHOTS;
| "SNAPSHOT_2021_03_09_09_10_52" | "VALID" | "127.0.0.1:9779" |
+--------------------------------+---------+------------------+
```

## 恢复快照

!!! warning

恢复快照数据时,如果快照中备份的图空间被删除(执行了`DROP SPACE`操作),那么该图空间数据将无法恢复。

当前未提供恢复快照命令,需要手动拷贝快照文件到对应的文件夹内,也可以通过 shell 脚本进行操作。实现逻辑如下:

1. 创建快照后,会在 leader Meta 服务器和所有 Storage 服务器的安装目录内生成`checkpoints`目录,保存创建的快照。以本文为例,当存在 2 个图空间时,创建的快照分别保存在`/usr/local/nebula/data/meta/nebula/0/checkpoints`、`/usr/local/nebula/data/storage/nebula/3/checkpoints`和`/usr/local/nebula/data/storage/nebula/4/checkpoints`中。
Expand Down