使用版本管理可以对作业回滚历史版本,增加操作的容错率。
在开发调试页的左上角单击版本管理可以在侧边弹窗中查看当前作业发布过的所有历史版本,单击某个版本,可以查看该版本的作业信息,但不可编辑。在版本管理弹窗中可以删除不需要的历史版本或对比不同版本的代码和配置差异。
![](https://qcloudimg.tencent-cloud.cn/image/document/b8e6318486241b3ed9533830327a053f.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/b8e6318486241b3ed9533830327a053f.png)
切换版本
若切换至某个已发布过的历史版本,需要先停止线上作业,停止后可以单击启动再次运行该版本,无需输入版本说明,只需根据作业的状态选择运行策略,再单击确认即可启动。
![](https://qcloudimg.tencent-cloud.cn/image/document/75b27ff591bec9ff4b91f40db44c1a59.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/75b27ff591bec9ff4b91f40db44c1a59.png)
版本对比
为了方便进行版本管理,您可以通过版本对比功能了解不同版本之间的差别,选择您需要的版本运行。版本对比功能支持对 SQL 作业的不同版本进行 SQL 代码和配置的对比。
首先在版本管理中选择一个版本作为您的初始对比版本,单击对比按钮。
![](https://qcloudimg.tencent-cloud.cn/image/document/60baf91e1b5a35b607da4ee40d119d58.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/60baf91e1b5a35b607da4ee40d119d58.png)
单击后进入版本对比弹窗,此时显示的代码为您刚刚选择的代码版本。您可以单击左侧的版本选择框中版本与当前版本进行对比。
![](https://qcloudimg.tencent-cloud.cn/image/document/2fc605d1070cbb4a16c26ec64b286209.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/2fc605d1070cbb4a16c26ec64b286209.png)
代码对比的差异会高亮展示出来,方便进行对比。
![](https://qcloudimg.tencent-cloud.cn/image/document/0ebde14b7e94afebc3a8448f04eb7403.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/0ebde14b7e94afebc3a8448f04eb7403.png)
单击配置对比,即可查看作业版本配置的对比详情。
![](https://qcloudimg.tencent-cloud.cn/image/document/626c7e863a0c1a2e912f9b34e8c8f3cb.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/626c7e863a0c1a2e912f9b34e8c8f3cb.png)
版本删除
在版本管理弹窗中点击对应版本后的删除按钮可以删除不需要的历史版本(不能删除正在运行的版本)。
![](https://qcloudimg.tencent-cloud.cn/image/document/075816d4846e777229b43511a9a2cf4c.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/075816d4846e777229b43511a9a2cf4c.png)