Skip to content

Commit

Permalink
when deleting a space, the snapshot of the space is also deleted (#2460)
Browse files Browse the repository at this point in the history
* when deleting a space, the snapshot of the space is also deleted

* add note for drop space

* Update 5.drop-space.md

* Update 5.drop-space.md

* Update 5.drop-space.md

* Update 5.drop-space.md

* Update 5.drop-space.md
  • Loading branch information
abby-cyber authored Jan 11, 2023
1 parent 3812577 commit f2a7c0e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
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

0 comments on commit f2a7c0e

Please sign in to comment.