Skip to content

Commit

Permalink
Merge pull request #2823 from oceanbase/merge_from_dev430_into_main
Browse files Browse the repository at this point in the history
merge from dev/4.3.0 into main
  • Loading branch information
yizhouxw authored Jun 30, 2024
2 parents 0bf0c38 + 65ce087 commit 7595ddd
Show file tree
Hide file tree
Showing 42 changed files with 413 additions and 46 deletions.
31 changes: 31 additions & 0 deletions CHANGELOG-zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
# OceanBase Developer Center (ODC) CHANGELOG

## 4.3.0_bp1(2024-06-24)

### 易用性改进

- 优化多库变更产生的子任务的描述信息,突出批次号及所属的多库变更任务 [#2762](https://github.com/oceanbase/odc/pull/2762)
- 允许计划任务的创建者修改计划任务 [#2772](https://github.com/oceanbase/odc/pull/2772)
- 消息通知支持配置网络超时 [#2782](https://github.com/oceanbase/odc/pull/2782)

### 缺陷修复

SQL 检查

- 禁止将"id"作为列名 [#2796](https://github.com/oceanbase/odc/pull/2796)

导入导出

- 导入空数据文件将会导致导数任务失败 [#2779](https://github.com/oceanbase/odc/pull/2779)

数据库对象管理

- 使用非 4.3.0 版本的 ODC 打开 4.3.x 版本的 OceanBase 的表对象可能会引发空指针异常 [#2776](https://github.com/oceanbase/odc/pull/2776)

SQL 开发

- SQL 语句的`like``replace`字句中包含反斜杠时将会引发格式化错误
- SQL 确认界面格式化按钮不生效

数据源

- 批量导入数据源时未能全部展示待导入的数据源

## 4.3.0 (2024-06-07)

### 功能变化
Expand Down
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
## 4.3.0_bp1 (2024-06-24)

### Usability Improvements

- Optimize the description information of subtasks generated by multi-repository changes, highlighting the batch number and the corresponding multi-repository change tasks [#2762](https://github.com/oceanbase/odc/pull/2762)
- The creator of a scheduled tasks is allowed to alter that schedule task [#2772](https://github.com/oceanbase/odc/pull/2772)
- Message notification supports configuring network timeout [#2782](https://github.com/oceanbase/odc/pull/2782)

### Bug Fixes

SQL check

- Disable "id" as column name [#2796](https://github.com/oceanbase/odc/pull/2796)

Import Export

- Importing empty data files will cause the derivative task to fail [#2779](https://github.com/oceanbase/odc/pull/2779)

Database object management

- Opening a table object of OceanBase version 4.3.x using an ODC other than version 4.3.0 may cause a null pointer exception [#2776](https://github.com/oceanbase/odc/pull/2776)

SQL development

- A formatting error will occur when backslashes are included in the `like` and `replace` clauses of the SQL statement
- The SQL confirmation interface button does not take effect

Data Source

- When importing data sources in batches, all data sources to be imported cannot be displayed

## 4.3.0 (2024-06-07)


Expand Down
40 changes: 40 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
(unreleased)
------------

Fix
~~~
- Fix(sql-check): remove the word 'id' from the reserved words (#2796)
[IL MARE]
- Fix(clientMode): fail to migrate metadb in client mode (#2797)
[LuckyLeo]
- Fix(data-transfer): avoid task failure by processing exception
messages (#2779) [LuckyLeo]
- Fix(table-object): there would be an NPE if fail to parse index ddl
(#2776) [LuckyLeo]
- Fix(multiple database): added exclusive description of the subticket
(#2762) [zijia.cj]
- Fix(taskframework): running task be canceled incorrect due to
heartbeat timeout (#2763) [krihy]
- Fix(schedule): creator is not allowed to alter schedule (#2772)
[guowl3]
- Fix(multiple database): frequently printing logs (#2765) [zijia.cj]
- Fix(taskframework): cannot rollback stop when destroy executor failed
(#2755) [krihy]
- Fix(client-mode): odc failed to start in client mode (#2761)
[LuckyLeo]


v4.3.0 (2024-06-11)
-------------------

New
~~~
- Feat(config):add creator_id to config entity (#2485) [Ang]
Expand Down Expand Up @@ -54,6 +80,8 @@ New

Changes
~~~~~~~
- Refactor(schedule): add without permission method (#2670) [Ang]
- Refactor(security): add configurable security whitelists (#2714) [Ang]
- Refactor(flow): add skip auth to flow mapper (#2538) [Ang]
- Refactor(config): Add more fields to configEntity #2493. [Ang]
- Chore: use OBE error code (#2413) [yizhou]
Expand All @@ -62,6 +90,18 @@ Changes

Fix
~~~
- Fix(schedule): terminate if schedule is invalid (#2725) [guowl3]
- Fix(structure-comparison): get a wrong result when comparing two same
tables (#2720) [IL MARE]
- Fix(multiple database): change the method when initiating child
tickets (#2719) [zijia.cj]
- Fix(ticket): failed to view all tickets (#2716) [IL MARE]
- Fix(dlm): upgrade dlm sdk to 1.1.4 (#2697) [guowl3]
- Fix(dlm): the task status does not update properly when structural
synchronization fails (#2712) [guowl3]
- Fix(ticket): project owners failed to abort a ticket (#2709) [IL MARE]
- Fix(db-browser): failed to open SYS console when user without query
sys permissions (#2708) [zhangxiao]
- Fix(security): add skip auth annotation (#2704) [guowl3]
- Fix(dlm): alter execute task job type for data cleaning (#2706) [kiko]
- Fix(multiple database): the return of method intercepted in multiple
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,36 @@ public void testReplaceVariables_VariableNotExists_ReplaceEmptyString() {

Assert.assertEquals(expected, actual);
}

@Test
public void testGetLocalMessage_NullLocale_ReturnTemplate() {
String template = "fake template";
String message = MessageTemplateProcessor.getLocalMessage(null, template);
Assert.assertEquals(template, message);
}

@Test
public void testGetLocalMessage_VariousLocale_Success() {
Locale locale1 = new Locale("en", "US");
String template1 = "${com.oceanbase.odc.builtin-resource.collaboration.environment.dev.name}";
String message1 = MessageTemplateProcessor.getLocalMessage(locale1, template1);
Assert.assertEquals("dev", message1);
Locale locale2 = new Locale("zh", "TW");
String template2 = "${com.oceanbase.odc.builtin-resource.collaboration.environment.dev.name}";
String message2 = MessageTemplateProcessor.getLocalMessage(locale2, template2);
Assert.assertEquals("開發", message2);
Locale locale3 = new Locale("zh", "CN");
String template3 = "${com.oceanbase.odc.builtin-resource.collaboration.environment.dev.name}";
String message3 = MessageTemplateProcessor.getLocalMessage(locale3, template3);
Assert.assertEquals("开发", message3);
}

@Test
public void testGetLocalMessage_NullTemplate_ReturnNull() {
Locale locale = new Locale("zh", "CN");
String template = null;
String message = MessageTemplateProcessor.getLocalMessage(locale, template);
Assert.assertEquals(null, message);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
package com.oceanbase.odc.common.i18n;

import java.io.IOException;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

Expand All @@ -31,7 +31,7 @@

public class I18nOutputSerializer extends JsonSerializer<String> {
private static final Pattern I18N_RESOURCE_PATTERN = Pattern.compile("\\$\\{([^{^}]*)\\}");
private static final Map<Locale, Map<String, String>> MESSAGES_MAP = new HashMap<>();
private static final Map<Locale, Map<String, String>> MESSAGES_MAP = new ConcurrentHashMap<>();

@Override
public void serialize(String value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
Expand All @@ -49,9 +49,8 @@ protected String convertString(String resource) {
if (!matcher.find()) {
return resource;
}

Locale currentLocale = LocaleContextHolder.getLocale();
MESSAGES_MAP.putIfAbsent(currentLocale, new HashMap<>());
MESSAGES_MAP.putIfAbsent(currentLocale, new ConcurrentHashMap<>());
int cursor = 0;
while (matcher.find(cursor)) {
String key = matcher.group();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ public enum Symbols implements Translatable {
/**
* ]
*/
RIGHT_BRACKET;
RIGHT_BRACKET,
/**
* ,
*/
COMMA;

@Override
public String code() {
Expand Down
30 changes: 18 additions & 12 deletions server/odc-core/src/main/resources/i18n/BusinessMessages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ com.oceanbase.odc.ResourceType.ODC_NOTIFICATION_CHANNEL=Notification Channel
com.oceanbase.odc.ResourceType.ODC_NOTIFICATION_POLICY=Notification Policy
com.oceanbase.odc.ResourceType.ODC_NOTIFICATION_MESSAGE=Notification Message
com.oceanbase.odc.ResourceType.ODC_STRUCTURE_COMPARISON_TASK=Structure Comparison Task
com.oceanbase.odc.ResourceType.ODC_DATABASE_CHANGE_ORDER_TEMPLATE=Database change order template
com.oceanbase.odc.ResourceType.ODC_DATABASE_CHANGE_ORDER_TEMPLATE=Database Change Order Template

#
# Batch Import
Expand Down Expand Up @@ -109,6 +109,7 @@ com.oceanbase.odc.FieldName.USER_DESCRIPTION=Comment

com.oceanbase.odc.Symbols.LEFT_BRACKET=[
com.oceanbase.odc.Symbols.RIGHT_BRACKET=]
com.oceanbase.odc.Symbols.COMMA=,


#
Expand Down Expand Up @@ -194,7 +195,7 @@ com.oceanbase.odc.AuditEventAction.EXECUTE_TASK=Execute task
com.oceanbase.odc.AuditEventAction.APPROVE=Approve
com.oceanbase.odc.AuditEventAction.REJECT=Reject
com.oceanbase.odc.AuditEventAction.CREATE_ASYNC_TASK=Create database change task
com.oceanbase.odc.AuditEventAction.CREATE_MULTIPLE_ASYNC_TASK=Create multiple database change task
com.oceanbase.odc.AuditEventAction.CREATE_MULTIPLE_ASYNC_TASK=Create batch database change task
com.oceanbase.odc.AuditEventAction.CREATE_MOCKDATA_TASK=Create mock data task
com.oceanbase.odc.AuditEventAction.CREATE_IMPORT_TASK=Create import task
com.oceanbase.odc.AuditEventAction.CREATE_EXPORT_TASK=Create export task
Expand All @@ -208,7 +209,7 @@ com.oceanbase.odc.AuditEventAction.CREATE_ONLINE_SCHEMA_CHANGE_TASK=Create onlin
com.oceanbase.odc.AuditEventAction.CREATE_APPLY_PROJECT_PERMISSION_TASK=Create apply project permission task
com.oceanbase.odc.AuditEventAction.CREATE_APPLY_DATABASE_PERMISSION_TASK=Create apply database permission task
com.oceanbase.odc.AuditEventAction.STOP_ASYNC_TASK=Stop database change task
com.oceanbase.odc.AuditEventAction.STOP_MULTIPLE_ASYNC_TASK=Stop multiple database change task
com.oceanbase.odc.AuditEventAction.STOP_MULTIPLE_ASYNC_TASK=Stop batch database change task
com.oceanbase.odc.AuditEventAction.STOP_MOCKDATA_TASK=Stop mock data task
com.oceanbase.odc.AuditEventAction.STOP_IMPORT_TASK=Stop import task
com.oceanbase.odc.AuditEventAction.STOP_EXPORT_TASK=Stop export task
Expand All @@ -221,7 +222,7 @@ com.oceanbase.odc.AuditEventAction.STOP_ONLINE_SCHEMA_CHANGE_TASK=Stop online sc
com.oceanbase.odc.AuditEventAction.STOP_APPLY_PROJECT_PERMISSION_TASK=Stop apply project permission task
com.oceanbase.odc.AuditEventAction.STOP_APPLY_DATABASE_PERMISSION_TASK=Stop apply database permission task
com.oceanbase.odc.AuditEventAction.EXECUTE_ASYNC_TASK=Execute database change task
com.oceanbase.odc.AuditEventAction.EXECUTE_MULTIPLE_ASYNC_TASK=Execute multiple database change task
com.oceanbase.odc.AuditEventAction.EXECUTE_MULTIPLE_ASYNC_TASK=Execute batch database change task
com.oceanbase.odc.AuditEventAction.EXECUTE_MOCKDATA_TASK=Execute mock data task
com.oceanbase.odc.AuditEventAction.EXECUTE_IMPORT_TASK=Execute import task
com.oceanbase.odc.AuditEventAction.EXECUTE_EXPORT_TASK=Execute export task
Expand All @@ -232,7 +233,7 @@ com.oceanbase.odc.AuditEventAction.EXECUTE_PARTITION_PLAN_TASK=Execute partition
com.oceanbase.odc.AuditEventAction.EXECUTE_ALTER_SCHEDULE_TASK=Execute alter schedule task
com.oceanbase.odc.AuditEventAction.EXECUTE_ONLINE_SCHEMA_CHANGE_TASK=Execute online schema change task
com.oceanbase.odc.AuditEventAction.APPROVE_ASYNC_TASK=Approve database change task
com.oceanbase.odc.AuditEventAction.APPROVE_MULTIPLE_ASYNC_TASK=Approve multiple database change task
com.oceanbase.odc.AuditEventAction.APPROVE_MULTIPLE_ASYNC_TASK=Approve batch database change task
com.oceanbase.odc.AuditEventAction.APPROVE_MOCKDATA_TASK=Approve mock data task
com.oceanbase.odc.AuditEventAction.APPROVE_IMPORT_TASK=Approve import task
com.oceanbase.odc.AuditEventAction.APPROVE_EXPORT_TASK=Approve export task
Expand All @@ -246,7 +247,7 @@ com.oceanbase.odc.AuditEventAction.APPROVE_ONLINE_SCHEMA_CHANGE_TASK=Approve onl
com.oceanbase.odc.AuditEventAction.APPROVE_APPLY_PROJECT_PERMISSION_TASK=Approve apply project permission task
com.oceanbase.odc.AuditEventAction.APPROVE_APPLY_DATABASE_PERMISSION_TASK=Approve apply database permission task
com.oceanbase.odc.AuditEventAction.REJECT_ASYNC_TASK=Reject database change task
com.oceanbase.odc.AuditEventAction.REJECT_MULTIPLE_ASYNC_TASK=Reject multiple database change task
com.oceanbase.odc.AuditEventAction.REJECT_MULTIPLE_ASYNC_TASK=Reject batch database change task
com.oceanbase.odc.AuditEventAction.REJECT_MOCKDATA_TASK=Reject mock data task
com.oceanbase.odc.AuditEventAction.REJECT_IMPORT_TASK=Reject import task
com.oceanbase.odc.AuditEventAction.REJECT_EXPORT_TASK=Reject export task
Expand Down Expand Up @@ -299,9 +300,9 @@ com.oceanbase.odc.AuditEventAction.BATCH_UPDATE_SENSITIVE_COLUMNS=Batch update s
com.oceanbase.odc.AuditEventAction.BATCH_DELETE_SENSITIVE_COLUMNS=Batch delete sensitive columns
com.oceanbase.odc.AuditEventAction.ENABLE_SENSITIVE_COLUMN=Enable sensitive column
com.oceanbase.odc.AuditEventAction.DISABLE_SENSITIVE_COLUMN=Disable sensitive column
com.oceanbase.odc.AuditEventAction.CREATE_DATABASE_CHANGE_CHANGING_ORDER_TEMPLATE=Create database change changing order template
com.oceanbase.odc.AuditEventAction.UPDATE_DATABASE_CHANGE_CHANGING_ORDER_TEMPLATE=Update database change changing order template
com.oceanbase.odc.AuditEventAction.DELETE_DATABASE_CHANGE_CHANGING_ORDER_TEMPLATE=Delete database change changing order template
com.oceanbase.odc.AuditEventAction.CREATE_DATABASE_CHANGE_CHANGING_ORDER_TEMPLATE=Create database change order template
com.oceanbase.odc.AuditEventAction.UPDATE_DATABASE_CHANGE_CHANGING_ORDER_TEMPLATE=Update database change order template
com.oceanbase.odc.AuditEventAction.DELETE_DATABASE_CHANGE_CHANGING_ORDER_TEMPLATE=Delete database change order template


#
Expand All @@ -317,7 +318,7 @@ com.oceanbase.odc.AuditEventType.RESOURCE_GROUP_MANAGEMENT=Resource group manage
com.oceanbase.odc.AuditEventType.MEMBER_MANAGEMENT=Member management
com.oceanbase.odc.AuditEventType.AUDIT_EVENT=Audit event
com.oceanbase.odc.AuditEventType.FLOW_CONFIG=Flow config
com.oceanbase.odc.AuditEventType.MULTIPLE_ASYNC=Multiple database Change
com.oceanbase.odc.AuditEventType.MULTIPLE_ASYNC=Batch database change
com.oceanbase.odc.AuditEventType.ASYNC=Database change
com.oceanbase.odc.AuditEventType.MOCKDATA=Mock data
com.oceanbase.odc.AuditEventType.IMPORT=Import
Expand All @@ -343,7 +344,7 @@ com.oceanbase.odc.AuditEventType.AUTOMATION_RULE_MANAGEMENT=Automation rule mana
com.oceanbase.odc.AuditEventType.NOTIFICATION_MANAGEMENT=Notification management
com.oceanbase.odc.AuditEventType.SENSITIVE_COLUMN_MANAGEMENT=Sensitive column management
com.oceanbase.odc.AuditEventType.STRUCTURE_COMPARISON=Structure comparison
com.oceanbase.odc.AuditEventType.DATABASE_CHANGE_CHANGING_ORDER_TEMPLATE_MANAGEMENT=Database change changing order template management
com.oceanbase.odc.AuditEventType.DATABASE_CHANGE_CHANGING_ORDER_TEMPLATE_MANAGEMENT=Database change order template management


#
Expand Down Expand Up @@ -804,7 +805,7 @@ com.oceanbase.odc.OBInstanceType.ORACLE_TENANT=Oracle Tenant
#
# TaskType
#
com.oceanbase.odc.TaskType.MULTIPLE_ASYNC=Multiple Database Change
com.oceanbase.odc.TaskType.MULTIPLE_ASYNC=Batch Database Change
com.oceanbase.odc.TaskType.ASYNC=Database Change
com.oceanbase.odc.TaskType.IMPORT=Import
com.oceanbase.odc.TaskType.EXPORT=Export
Expand Down Expand Up @@ -850,6 +851,11 @@ com.oceanbase.odc.notification.channel-test-message=【ODC】Channel verificatio
com.oceanbase.odc.builtin-resource.permission-apply.project.description=Requesting [{1}] permissions for project [{0}]
com.oceanbase.odc.builtin-resource.permission-apply.database.description=Requesting [{0}] permissions for databases

#
# Multiple Async
#
com.oceanbase.odc.builtin-resource.multiple-async.sub-ticket.description=[{0}]batch database change {1} batch no.{2} {3}.{4}

#
# ResourceRoleName
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ com.oceanbase.odc.FieldName.USER_DESCRIPTION=备注

com.oceanbase.odc.Symbols.LEFT_BRACKET=
com.oceanbase.odc.Symbols.RIGHT_BRACKET=
com.oceanbase.odc.Symbols.COMMA=

#
# LimitMetric
Expand Down Expand Up @@ -787,6 +788,11 @@ com.oceanbase.odc.notification.channel-test-message=【ODC】消息通道验证
com.oceanbase.odc.builtin-resource.permission-apply.project.description=申请项目【{0}】的【{1}】权限
com.oceanbase.odc.builtin-resource.permission-apply.database.description=申请数据库的【{0}】权限

#
# Multiple Async
#
com.oceanbase.odc.builtin-resource.multiple-async.sub-ticket.description=【{0}】多库变更 {1} 第{2}批 {3}.{4}

#
# ResourceRoleName
#
Expand All @@ -811,5 +817,4 @@ com.oceanbase.odc.DatabasePermissionType.EXPORT=导出
com.oceanbase.odc.PartitionPlanVariableKey.INTERVAL=间隔
com.oceanbase.odc.PartitionPlanVariableKey.LAST_PARTITION_VALUE=最后一个分区规则对应位置表达式的值
com.oceanbase.odc.partitionplan.TimeDataType=时间类型
com.oceanbase.odc.partitionplan.NumberDataType=数字类型

com.oceanbase.odc.partitionplan.NumberDataType=数字类型
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ com.oceanbase.odc.FieldName.USER_DESCRIPTION=備註

com.oceanbase.odc.Symbols.LEFT_BRACKET=
com.oceanbase.odc.Symbols.RIGHT_BRACKET=
com.oceanbase.odc.Symbols.COMMA=

#
# LimitMetric
Expand Down Expand Up @@ -856,6 +857,11 @@ com.oceanbase.odc.notification.channel-test-message=【ODC】消息通道驗證
com.oceanbase.odc.builtin-resource.permission-apply.project.description=申請項目【{0}】的【{1}】權限
com.oceanbase.odc.builtin-resource.permission-apply.database.description=申請數據庫的【{0}】權限

#
# Multiple Async
#
com.oceanbase.odc.builtin-resource.multiple-async.sub-ticket.description=【{0}】多庫變更 {1} 第{2}批 {3}.{4}

#
# ResourceRoleName
#
Expand Down
2 changes: 2 additions & 0 deletions server/odc-server/src/main/resources/data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,8 @@ VALUES ('odc.notification.max-resend-times', '3', 'odc', 'default', 'master', '
update `id`=`id`;
insert into `config_system_configuration` (`key`, `value`, `application`, `profile`, `label`, `description`)
VALUES ('odc.notification.host-black-list', '', 'odc', 'default', 'master', 'The Hosts in this black list are NOT allowed to prevent SSRF security vulnerabilities. The black list is empty by default, allowing access to all Hosts.') ON DUPLICATE KEY update `id`=`id`;
insert into `config_system_configuration` (`key`, `value`, `application`, `profile`, `label`, `description`)
VALUES ('odc.notification.send-timeout-millis', '10000', 'odc', 'default', 'master', 'The network timeout for sending notifications. Default to 10000ms') ON DUPLICATE KEY update `id`=`id`;

INSERT INTO config_system_configuration(`key`, `value`, `description`) VALUES('odc.lab.resource.mysql-init-script-template',
'create user if not exists {{dbUsername}}@''%'' identified by {{password}}; create database if not exists {{dbName}}; grant all privileges on {{dbName}}.* to {{dbUsername}}@''%''; grant select on oceanbase.gv$tenant to {{dbUsername}}@''%''; grant select on oceanbase.gv$unit to {{dbUsername}}@''%''; grant select on oceanbase.gv$table to {{dbUsername}}@''%''; grant select on oceanbase.gv$sysstat to {{dbUsername}}@''%''; grant select on oceanbase.gv$memory to {{dbUsername}}@''%''; grant select on oceanbase.gv$memstore to {{dbUsername}}@''%''; grant select on oceanbase.gv$sql_audit to {{dbUsername}}@''%''; grant select on oceanbase.gv$plan_cache_plan_stat to {{dbUsername}}@''%''; grant select on oceanbase.gv$plan_cache_plan_explain to {{dbUsername}}@''%'';'
Expand Down
Loading

0 comments on commit 7595ddd

Please sign in to comment.