PostgreSQL中怎么使用snapshot操作接口函数

网友投稿 402 2024-02-26

***中怎么使用snapshot操作接口函数

本篇内容介绍了“***中怎么使用snapshot操作接口函数”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!

***中怎么使用snapshot操作接口函数

snapshot 操作接口函数

1、创建快照,当BLOCK发生变更时,变更之前的BLOCK(旧版本),写入*.snapmap.SNAP_ID file文件中。直到snapshot被删除。

/*    * Create new snapshot. Starting from this moment Postgres will store original copies of all updated pages.    * Them will be stored in shanpshot file (*.snap.SNAP_ID and addressed through *.snapmap.SNAP_ID file) until    * snapshot is deleted by sfs_remove_snapshot function or new snapshot is created.    */   externSnapshotIdsfs_make_snapshot(void);

2、删除snapshot.

/*    * Remove snapshot with all its files    */   extern void sfs_remove_snapshot(SnapshotId sid);

3、将数据库恢复到指定snapshot.

/*    * Reset database state to the paritcular snapshot.     * It will be not possible any more to recover to any of more recent snashots or to the most recent database state.    */   extern void sfs_recover_to_snapshot(SnapshotId sid);

4、查看数据库过去的某个状态。(并不是恢复到过去的状态)

/*    * Temporary switch instance to the particular snashot. It will be possible to return back to the most recent database state or to switch to any other snapshot    */   extern void sfs_switch_to_snapshot(SnapshotId sid);

5、仅仅将当前的BACKEND PID,切换到数据库过去某个SNAPSHOT ID的状态,而不是将所有BACKEND切换到过去的某个状态。

/*    * Set snapshot for backend,  unlike sfs_switch_to_snapshot function, it switchces snapshot for the current backend and not for all server instance.    */   extern void sfs_set_backend_snapshot(SnapshotId sid);

这些接口与ZFS的SNAPSHOT功能非常类似。

“***中怎么使用snapshot操作接口函数”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注网站,小编将为大家输出更多高质量的实用文章!

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:集群部署,千万级Redis性能提升(集群版redis)
下一篇:TiDB HTAP特性的应用场景简析与探讨
相关文章