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

You want to add a modified configuration staging function 希望添加修改配置暂存功能 #4865

Closed
370569218 opened this issue Feb 3, 2021 · 14 comments
Labels
status/wontfix This will not be worked on

Comments

@370569218
Copy link

You want to add the modified configuration staging function. Sometimes you need to modify some configuration but you are not in a hurry to publish. You can click staging to save the modified configuration
希望添加修改配置暂存功能,有些时候需要修改某些配置但不急于发布可以单击暂存将修改的配置暂存起来

@KomachiSion KomachiSion added kind/feature type/feature kind/discussion Category issues related to discussion contribution welcome labels Feb 3, 2021
@haoyann
Copy link
Collaborator

haoyann commented Feb 3, 2021

我有一个想法去实现这个功能,不知可不可行。
新增一个表,字段多比原来的配置表多一个状态字段,表示是保存还是发布,然后界面配置的查询接口、保存接口就操作这个表,发布的逻辑和原来一样,只不过需要增加将这表的状态改为发布。这样实现这个功能影响的只有面向界面的接口,其余的客户端逻辑和集群间的通讯都保持不变。

@ruanwenjun
Copy link

我有一个想法去实现这个功能,不知可不可行。
新增一个表,字段多比原来的配置表多一个状态字段,表示是保存还是发布,然后界面配置的查询接口、保存接口就操作这个表,发布的逻辑和原来一样,只不过需要增加将这表的状态改为发布。这样实现这个功能影响的只有面向界面的接口,其余的客户端逻辑和集群间的通讯都保持不变。

@haoyann 如果是新增一张表的话不需要额外维护状态字段,发布之后更新配置表,将新增的表中数据删除即可。

@haoyann
Copy link
Collaborator

haoyann commented Feb 26, 2021

@ruanwenjun 不增加状态字段,就不方便知道当前配置是发布还是暂存了。

@ruanwenjun
Copy link

@ruanwenjun 不增加状态字段,就不方便知道当前配置是发布还是暂存了。

如果在暂存表中存在配置数据的话那么是暂存配置,暂存表中不存放已发布的配置

@zhangcly
Copy link
Contributor

@i will solve it@

@mentoswang
Copy link

想请问config_info表中 c_use 和 effect 字段是预留给什么功能扩展的?
c_use varchar(64) DEFAULT NULL,
effect varchar(64) DEFAULT NULL,

mentoswang pushed a commit to mentoswang/nacos that referenced this issue Jun 21, 2021
What is the purpose of the change
The purpose of this change is to seperate config save and publish operation, which can have some configuration saved and reviewed or approved before publish.

Brief changelog
Open API:
- POST /nacos/v1/cs/configs/draft to draft config, support import=true
- GET /nacos/v1/cs/configs/draft to get draft config, support show=all, search=accurate and search=blur, support config tags
- DELETE /nacos/v1/cs/configs/draft to delete draft config, support delType=ids
- POST /nacos/v1/cs/configs/publish?dataId=xxx to publish draft config
Java SDK:
- draftConfig, getDraftConfig, removeDraftConfig, publishConfigFromDraft
Persist Data Storage:
- Add two new tables config_info_draft and config_tags_relation_draft, as well as related indexes for both embedded and external database (derby and mysql)

Verifying this change
UT:
- Jave SDK mock testcases are added in ClientWorkerTest and NacosConfigServiceTest
IT:
- New api testcases are added in AbstractConfigAPI_CITCase and ConfigExportAndImportAPI_CITCase
- Config auth testcases for the new api are added in ConfigAuth_ITCase
- Distributed embedded database testcases for the new api are added in ConfigDerbyRaft_DITCase
@KomachiSion
Copy link
Collaborator

我觉得这个功能还是需要再讨论一下。 我个人认为这个功能应该存放在前端cookie,而不是存在服务端数据库。

本身就是暂存调试的状态,又不发布,存数据库导致大量数据库冗余数据。而且暂存的配置很可能并不需要多人调试,应该也没有可见性问题。

@mentoswang
Copy link

考虑加draft config的接口,拆分保存和发布的功能,主要目的是可以在配置发布之前加入审批的逻辑,发布之后draft数据可以删除,并且可以不保留history记录(不支持保存多版本配置),应该可以解决数据冗余的问题

@KomachiSion
Copy link
Collaborator

我觉得这个不是nacos应该做的工作,应该是工单系统应该做的事,nacos就只是应该作为配置中心来进行管理。暂存功能我觉得就是应该只存在控制台cookie中,作为临时编辑。

审批流程控制应该是另外一个系统,进行保存和记录,可追述申请和审批流程。然后对接openAPI来进行操作。这是两个系统的事。

@mentoswang
Copy link

审批流程确实应该由另一个系统控制,nacos不会涉及审批操作,但配置数据希望能利用nacos底层统一的数据存储,是考虑到能更方便保证数据的一致性,降低配置数据传输的代价,以及后续考虑数据安全,降低读写加解密的开销

@Moskalnazar
Copy link

ok

1 similar comment
@Moskalnazar
Copy link

ok

@KomachiSion
Copy link
Collaborator

那应该由另一个系统来暂存吧,如果待审批配置也存在nacos这边,那不就还是nacos来控制了吗?

既然有审计系统拦截在nacos前,nacos就不应该直接参与审计流程中,最多提供openAPI来查询当前配置或历史配置。其他的一切审计流程都不在nacos中,只有审计流程全部走完,才会调用nacos进行发布。

如果你们有强烈的希望存储在nacos中,那只能自行修改然后使用了。主干分支不会去执行这样的hack逻辑。

@mask616
Copy link
Contributor

mask616 commented Aug 5, 2021

Nacos出一个定时发布配置, 或者定时修改配置的功能怎么样?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

8 participants