【 使用环境 】测试环境
【 OB or 其他组件 】
observer和obcdc
【 使用版本 】
社区版4.1
【问题描述】清晰明确描述问题
obcdc连接observer报时区不正确(fail to get get_tz_info_by_name(tz_name=Zulu, ret=-4018)
)
【复现路径】问题出现前后相关操作
obcdc 相关配置
config.add(“rootserver_list”, obpConfig.binlog_service_ip.str());
config.add(“cluster_user”, “root@sys”);
config.add(“cluster_password”, “111111”);
config.add(“timezone”,“Zulu”);
【问题现象及影响】
使用该配置连接observer,一直处于时区报错
报错内容为
[2023-11-21 04:17:28.068683] WDIAG [LIB.TIME] get_tz_info_by_name (ob_timezone_info.cpp:39833) [3026069][][T0][Y0-0000000000000000-0-0] [lt=13][errcode=-4018] fail to get get_tz_info_by_name(tz_name=Zulu, ret=-4018)
[2023-11-21 04:17:28.068717] WDIAG [LIB.TIME] init_time_zone (ob_timezone_info.cpp:39933) [3026069][][T0][Y0-0000000000000000-0-0] [lt=33][errcode=-5192] fail to get time zone info(tz_name=Zulu, ret=-5192)
[2023-11-21 04:17:28.068731] ERROR issue_dba_error (ob_log.cpp:1792) [3026069][][T0][Y0-0000000000000000-0-0] [lt=11][errcode=-4388] Unexpected internal error happen, please checkout the internal errcode(errcode=-5192, file="ob_log_timezone_info_getter.cpp", line_no=65, info="tz_info_wrap set_time_zone failed")
[2023-11-21 04:17:28.068745] EDIAG [TLOG.SCHEMA] set_time_zone (ob_log_timezone_info_getter.cpp:65) [3026069][][T0][Y0-0000000000000000-0-0] [lt=14][errcode=-5192] tz_info_wrap set_time_zone failed(ret=-5192, ret="OB_ERR_UNKNOWN_TIME_ZONE", timezone_str=Zulu, this={tenant_id:1001, is_inited:true, timezone_info_version:-1, tz_info_wrap:{cur_version:-1, class:0, tz_info:null, error_on_overlap_time:false, tz_info_pos:{tz_name:"", tz_id:-1, default_transition_type:{lower_time:-9223372036854775808, info:{offset_sec:0, tran_type_id:-1, is_dst:false, abbr:""}}, tz_transition_types:[], tz_revert_types:[], curr_idx:0, next_tz_transition_types:[], next_tz_revert_types:[]}, tz_info_offset:{id:-1, offset:0, error_on_overlap_time:false}}}) BACKTRACE:0x13b0bbbd 0x9e2ae70 0x9e2a951 0x9e2a5ec 0x9e2a3e5 0xa1a08ad 0xa1a340e 0xa1a0a3b 0x138b4e46 0x138b1bfc 0x137cfbd2 0x137c85d0 0x137c723e 0x1274eaf5 0x1274bb11 0x1274b1e1 0x119bf8f3 0x119be7b2 0xa0bec5d 0x9ef1ee4 0x9eec6c1 0x9ee4fd7 0x9ee5ae7 0x9ee5859 0x1a77fb8 0x1a75d1f 0x18f8b20 0x18d7116 0x18e1a42 0x75beb9 0x7fffb58f9c87 0x74c7ea
[2
2.查看observer代码,发现时区的插入为
SELECT *
FROM (
SELECT t1.time_zone_id, t1.inner_tz_id, t1.name, t3.transition_time, t2.offset, t2.is_dst,
t2.transition_type_id, t2.abbreviation,
row_number() over (partition by t1.inner_tz_id, t3.transition_time order by t2.transition_type_id) as tran_row_number
FROM (SELECT time_zone_id, row_number() over (order by time_zone_id) as inner_tz_id, name
FROM oceanbase.__all_tenant_time_zone_name
ORDER BY time_zone_id
) t1
JOIN oceanbase.__all_tenant_time_zone_transition_type t2
ON t1.time_zone_id = t2.time_zone_id
LEFT JOIN oceanbase.__all_tenant_time_zone_transition t3
ON t2.time_zone_id = t3.time_zone_id
AND t2.transition_type_id=t3.transition_type_id
) tz_info WHERE tz_info.tran_row_number = 1
ORDER BY tz_info.time_zone_id, tz_info.transition_time ;```
3.然后使用root@sys用户在对应的表插入数据,例如
INSERT INTO oceanbase.__all_tenant_time_zone (Time_zone_id, Use_leap_seconds) VALUES (574, ‘N’);
INSERT INTO oceanbase.__all_tenant_time_zone_name (Name, Time_zone_id) VALUES (‘Zulu’, 574);
INSERT INTO oceanbase.__all_tenant_time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
(574, 0, 0, 0, ‘UTC’)
;
4.运行2中语句,发现时区确实插入成功,检查libcdc日志发现也确实添加成功
5.但是发现root@test用户无法识别Zulu时区,还是报错,登录root@test,执行2中sql确实不存在内容
6.root@test执行
INSERT INTO oceanbase.__all_tenant_time_zone (Time_zone_id, Use_leap_seconds) VALUES (574, ‘N’);
INSERT INTO oceanbase.__all_tenant_time_zone_name (Name, Time_zone_id) VALUES (‘Zulu’, 574);
INSERT INTO oceanbase.__all_tenant_time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
(574, 0, 0, 0, ‘UTC’)
;
7.报错 ERROR 1044 (42000): Access denied for user 'root'@'%' to database 'oceanbase'
问题:
如何为root@test添加正确的时区比如增加Zulu
【附件】