-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
gray publish model refactor #12824
gray publish model refactor #12824
Conversation
* 34567 * refactor gray model * pmd checkstyle * 兼容性处理 * 灰度增量对账 * 升级内容字段编码,添加gray表 * pmd and checkstyle * merge develop fix conflict * derby create gray table * modify gray table sql * derby sql bugfix * fix test case * fix test case * fix test case
…libaba#12507) * Refine the formal configuration and add additional information(alibaba#12217) * Change the "configType" field to "publishType"(alibaba#12217) * Improve the gray configuration(alibaba#12217) * add the reconciliation mechanism of gray configuration(alibaba#12217) * Change the JSON format of gray rule.(alibaba#12217) * Remove redundant queries(alibaba#12217) * fix reconciliation mechanism of gray configuration.(alibaba#12217) * Adjust the way of obtaining grayName.(alibaba#12217) * Change the variable name.(alibaba#12217)
…h-refactor # Conflicts: # config/src/main/java/com/alibaba/nacos/config/server/constant/PropertiesConstant.java # config/src/main/java/com/alibaba/nacos/config/server/remote/ConfigChangeClusterSyncRequestHandler.java # config/src/main/java/com/alibaba/nacos/config/server/service/dump/disk/ConfigRawDiskService.java # config/src/test/java/com/alibaba/nacos/config/server/service/dump/disk/ConfigRawDiskServiceTest.java # console/src/main/resources/static/index.html # console/src/main/resources/static/js/main.js
Thanks for your this PR. 🙏 感谢您提交的PR。 🙏 |
|
|
|
|
|
|
|
|
|
|
2. gray model upgrade compatible 3. delete aggr model code
…to develop-graypublish-refactor
create a new pr ,close current |
|
What is the purpose of the change
Gray Model Refactor
1.create config_info_gray model support gray publish and keep extentionable.
2. use new gray model to uniform beta(tag) model
3. auto migrate beta(tag) table data into config_info_gray during version upgrade period
4. modify beta(tag)publish logic, double write into beta(tag) and gray model on compatibity period ,support version rollback
5. modify config query logic , check beta (tag) from new gray models.
6. double write compatibity will still existed during further serval versions ,and then all beta ,tag code could be deleted on 3.0 version.
Gray History Supprt
Basic on gray model refactor , @MatthewAden support gray publish history and add gray model consistency between server and database. https://github.com/alibaba/nacos/issues/12217,support changed gray config and deleted gray configs .
Remove Aggr Code
Aggr model is used Within Alibaba Group ,this function is never supported on open source ,and also highly limited in Alibaba Group,
thus The aggr code is deleted in this pr for reducing code complexity and Improving the maintainability of the code repository.
Brief changelog
sql schema change :
new table config_info_gray model for new gray model:
CREATE TABLE
config_info_gray
(id
bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',data_id
varchar(255) NOT NULL COMMENT 'data_id',group_id
varchar(128) NOT NULL COMMENT 'group_id',content
longtext NOT NULL COMMENT 'content',md5
varchar(32) DEFAULT NULL COMMENT 'md5',src_user
text COMMENT 'src_user',src_ip
varchar(100) DEFAULT NULL COMMENT 'src_ip',gmt_create
datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT 'gmt_create',gmt_modified
datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT 'gmt_modified',app_name
varchar(128) DEFAULT NULL COMMENT 'app_name',tenant_id
varchar(128) DEFAULT '' COMMENT 'tenant_id',gray_name
varchar(128) NOT NULL COMMENT 'gray_name',gray_rule
text NOT NULL COMMENT 'gray_rule',encrypted_data_key
varchar(256) NOT NULL DEFAULT '' COMMENT 'encrypted_data_key',PRIMARY KEY (
id
),UNIQUE KEY
uk_configinfogray_datagrouptenantgray
(data_id
,group_id
,tenant_id
,gray_name
),KEY
idx_dataid_gmt_modified
(data_id
,gmt_modified
),KEY
idx_gmt_modified
(gmt_modified
)) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='config_info_gray'
table his_config_info change for gray publish history:
ALTER TABLE his_config_info ADD COLUMN
publish_type
varchar(50) DEFAULT 'formal' COMMENT 'publish type gray or formal'ALTER TABLE his_config_info ADD COLUMN
ext_info
longtext DEFAULT NULL COMMENT 'ext info',