生产环境 oceanbase_ce 4.2.1.BP7 版本
【问题描述】使用oms迁移时全量校验时,会产生类似于如下SQL
mysql>select /+QUERY_TIMEOUT(600000000) END_OUTLINE_DATA/ TABLE_SCHEMA
,TABLE_NAME
,INDEX_NAME
,NON_UNIQUE
,SEQ_IN_INDEX
,COLUMN_NAME
,SUB_PART
from information_schema.STATISTICS where ((TABLE_SCHEMA=‘test27db’ AND TABLE_NAME in (‘test_table1’,‘test_table4’))
OR (TABLE_SCHEMA=‘test04db’ AND TABLE_NAME in (‘test_table4’,‘test_table3’))
OR (TABLE_SCHEMA=‘test48db’ AND TABLE_NAME in (‘test_table1’))
OR (TABLE_SCHEMA=‘test25db’ AND TABLE_NAME in (‘test_table1’,‘test_table4’))
OR (TABLE_SCHEMA=‘test06db’ AND TABLE_NAME in (‘test_table4’,‘test_table3’))
OR (TABLE_SCHEMA=‘test08db’ AND TABLE_NAME in (‘test_table3’,‘test_table4’))
OR (TABLE_SCHEMA=‘test29db’ AND TABLE_NAME in (‘test_table1’,‘test_table4’))
OR (TABLE_SCHEMA=‘test42db’ AND TABLE_NAME in (‘test_table1’))
OR (TABLE_SCHEMA=‘test63db’ AND TABLE_NAME in (‘test_table1’,‘test_table5’))
OR (TABLE_SCHEMA=‘test40db’ AND TABLE_NAME in (‘test_table1’))
OR (TABLE_SCHEMA=‘test61db’ AND TABLE_NAME in (‘test_table1’,‘test_table5’))
OR (TABLE_SCHEMA=‘test23db’ AND TABLE_NAME in (‘test_table1’,‘test_table4’))
OR (TABLE_SCHEMA=‘test46db’ AND TABLE_NAME in (‘test_table1’))
OR (TABLE_SCHEMA=‘test44db’ AND TABLE_NAME in (‘test_table1’))
OR (TABLE_SCHEMA=‘test21db’ AND TABLE_NAME in (‘test_table4’,‘test_table1’))
OR (TABLE_SCHEMA=‘test02db’ AND TABLE_NAME in (‘test_table3’,‘test_table4’))
OR (TABLE_SCHEMA=‘test14db’ AND TABLE_NAME in (‘test_table4’))
OR (TABLE_SCHEMA=‘test39db’ AND TABLE_NAME in (‘test_table1’))
OR (TABLE_SCHEMA=‘test37db’ AND TABLE_NAME in (‘test_table4’,‘test_table1’))
OR (TABLE_SCHEMA=‘test16db’ AND TABLE_NAME in (‘test_table4’))
OR (TABLE_SCHEMA=‘test58db’ AND TABLE_NAME in (‘test_table5’,‘test_table1’))
OR (TABLE_SCHEMA=‘test18db’ AND TABLE_NAME in (‘test_table4’))
OR (TABLE_SCHEMA=‘test31db’ AND TABLE_NAME in (‘test_table1’,‘test_table4’))
OR (TABLE_SCHEMA=‘test52db’ AND TABLE_NAME in (‘test_table1’))
OR (TABLE_SCHEMA=‘test50db’ AND TABLE_NAME in (‘test_table1’))
OR (TABLE_SCHEMA=‘test56db’ AND TABLE_NAME in (‘test_table1’))
OR (TABLE_SCHEMA=‘test10db’ AND TABLE_NAME in (‘test_table2’,‘test_table3’))
OR (TABLE_SCHEMA=‘test35db’ AND TABLE_NAME in (‘test_table1’,‘test_table2’))
OR (TABLE_SCHEMA=‘test54db’ AND TABLE_NAME in (‘test_table1’))
OR (TABLE_SCHEMA=‘test12db’ AND TABLE_NAME in (‘test_table2’))
OR (TABLE_SCHEMA=‘test33db’ AND TABLE_NAME in (‘test_table1’,‘test_table2’))
OR (TABLE_SCHEMA=‘test03db’ AND TABLE_NAME in (‘test_table3’,‘test_table2’))
OR (TABLE_SCHEMA=‘test28db’ AND TABLE_NAME in (‘test_table1’,‘test_table2’))
OR (TABLE_SCHEMA=‘test49db’ AND TABLE_NAME in (‘test_table1’))
OR (TABLE_SCHEMA=‘test26db’ AND TABLE_NAME in (‘test_table2’,‘test_table1’))
OR (TABLE_SCHEMA=‘test05db’ AND TABLE_NAME in (‘test_table3’,‘test_table2’))
OR (TABLE_SCHEMA=‘test47db’ AND TABLE_NAME in (‘test_table1’))
OR (TABLE_SCHEMA=‘test07db’ AND TABLE_NAME in (‘test_table3’,‘test_table2’))
OR (TABLE_SCHEMA=‘test09db’ AND TABLE_NAME in (‘test_table3’,‘test_table2’))
OR (TABLE_SCHEMA=‘test41db’ AND TABLE_NAME in (‘test_table1’))
OR (TABLE_SCHEMA=‘test20db’ AND TABLE_NAME in (‘test_table1’,‘test_table2’))
OR (TABLE_SCHEMA=‘test62db’ AND TABLE_NAME in (‘test_table5’,‘test_table1’))
OR (TABLE_SCHEMA=‘test45db’ AND TABLE_NAME in (‘test_table1’))
OR (TABLE_SCHEMA=‘test24db’ AND TABLE_NAME in (‘test_table1’,‘test_table2’))
OR (TABLE_SCHEMA=‘test43db’ AND TABLE_NAME in (‘test_table1’))
OR (TABLE_SCHEMA=‘test01db’ AND TABLE_NAME in (‘test_table3’,‘test_table2’))
OR (TABLE_SCHEMA=‘test64db’ AND TABLE_NAME in (‘test_table5’,‘test_table1’))
OR (TABLE_SCHEMA=‘test22db’ AND TABLE_NAME in (‘test_table1’,‘test_table2’))
OR (TABLE_SCHEMA=‘test60db’ AND TABLE_NAME in (‘test_table5’,‘test_table1’))
OR (TABLE_SCHEMA=‘test15db’ AND TABLE_NAME in (‘test_table2’))
OR (TABLE_SCHEMA=‘test38db’ AND TABLE_NAME in (‘test_table1’))
OR (TABLE_SCHEMA=‘test17db’ AND TABLE_NAME in (‘test_table2’))
OR (TABLE_SCHEMA=‘test36db’ AND TABLE_NAME in (‘test_table1’,‘test_table2’))
OR (TABLE_SCHEMA=‘test59db’ AND TABLE_NAME in (‘test_table1’,‘test_table5’))
OR (TABLE_SCHEMA=‘test19db’ AND TABLE_NAME in (‘test_table2’))
OR (TABLE_SCHEMA=‘test53db’ AND TABLE_NAME in (‘test_table1’))
OR (TABLE_SCHEMA=‘test30db’ AND TABLE_NAME in (‘test_table2’,‘test_table1’))
OR (TABLE_SCHEMA=‘test51db’ AND TABLE_NAME in (‘test_table1’))
OR (TABLE_SCHEMA=‘test57db’ AND TABLE_NAME in (‘test_table1’))
OR (TABLE_SCHEMA=‘test11db’ AND TABLE_NAME in (‘test_table2’,‘test_table3’))
OR (TABLE_SCHEMA=‘test34db’ AND TABLE_NAME in (‘test_table2’,‘test_table1’))
OR (TABLE_SCHEMA=‘test13db’ AND TABLE_NAME in (‘test_table2’))
OR (TABLE_SCHEMA=‘test55db’ AND TABLE_NAME in (‘test_table1’))
OR (TABLE_SCHEMA=‘test32db’ AND TABLE_NAME in (‘test_table1’,‘test_table2’))
)
order by TABLE_SCHEMA
,TABLE_NAME
,INDEX_NAME
, SEQ_IN_INDEX
asc;
##执行会报 ERROR 4013 (HY001): No memory or reach tenant memory limit
2、observer中日志
observer.log.20240705124326394:[2024-07-05 12:43:17.315273] WARN common_alloc (ob_tenant_ctx_allocator.cpp:457) [245496][T1002_ArcTimer][T1002][YB420A6DD963-00061BB79540BD31-0-0] [lt=0][errcode=-4013] No memory or reach tenant memory limit([OOPS]=“alloc failed reason”, msg=tenant memory has reached the upper limit(tenant_id: 1002, tenant_hold: 144954884096, tenant_limit: 144955146240, alloc_size: 2121728))
observer.log.20240705124326394:[2024-07-05 12:43:17.406793] WARN common_alloc (ob_tenant_ctx_allocator.cpp:457) [150041][TimezoneMgr][T1002][YB420A6DD963-00061BB791981954-0-0] [lt=0][errcode=-4013] No memory or reach tenant memory limit([OOPS]=“alloc failed reason”, msg=tenant memory has reached the upper limit(tenant_id: 1002, tenant_hold: 144954884096, tenant_limit: 144955146240, alloc_size: 2097152))
observer.log.20240705124326394:[2024-07-05 12:43:17.446865] WARN common_alloc (ob_tenant_ctx_allocator.cpp:457) [245735][T1002_L0_G0][T1002][YB420A6DD963-00061BB7F0C858BE-0-0] [lt=0][errcode=-4013] No memory or reach tenant memory limit([OOPS]=“alloc failed reason”, msg=tenant memory has reached the upper limit(tenant_id: 1002, tenant_hold: 144954884096, tenant_limit: 144955146240, alloc_size: 2097152))
observer.log.20240705125020032:[2024-07-05 12:44:39.672132] WARN common_alloc (ob_tenant_ctx_allocator.cpp:457) [245486][T1002_TenantWea][T1002][Y0-0000000000000000-0-0] [lt=5][errcode=-4013] No memory or reach tenant memory limit([OOPS]=“alloc failed reason”, msg=tenant memory has reached the upper limit(tenant_id: 1002, tenant_hold: 144954195968, tenant_limit: 144955146240, alloc_size: 2097152))
observer.log.20240705125020032:[2024-07-05 12:44:39.737063] WARN common_alloc (ob_tenant_ctx_allocator.cpp:457) [245503][T1002_TxLoopWor][T1002][Y0-0000000000000000-0-0] [lt=0][errcode=-4013] No memory or reach tenant memory limit([OOPS]=“alloc failed reason”, msg=tenant memory has reached the upper limit(tenant_id: 1002, tenant_hold: 144954195968, tenant_limit: 144955146240, alloc_size: 2097152))
observer.log.20240705125020032:[2024-07-05 12:44:39.755771] WARN common_alloc (ob_tenant_ctx_allocator.cpp:457) [245678][T1002_L0_G0][T1002][YB420A6DD963-00061BB7ED5AA15D-0-0] [lt=0][errcode=-4013] No memory or reach tenant memory limit([OOPS]=“alloc failed reason”, msg=tenant memory has reached the upper limit(tenant_id: 1002, tenant_hold: 144954195968, tenant_limit: 144955146240, alloc_size: 2097152))
observer.log.20240705125020032:[2024-07-05 12:44:39.755917] WARN common_alloc (ob_tenant_ctx_allocator.cpp:457) [149421][pnio1][T0][YB420A3AEBAA-00061BB9B96F4E31-0-0] [lt=3][errcode=-4013] No memory or reach tenant memory limit([OOPS]=“alloc failed reason”, msg=tenant memory has reached the upper limit(tenant_id: 1002, tenant_hold: 144954195968, tenant_limit: 144955146240, alloc_size: 2097152))
observer.log.20240705125020032:[2024-07-05 12:44:39.756491] WARN common_alloc (ob_tenant_ctx_allocator.cpp:457) [149419][pnio1][T0][YB420A3AEBAA-00061BB9B96F4E2F-0-0] [lt=0][errcode=-4013] No memory or reach tenant memory limit([OOPS]=“alloc failed reason”, msg=tenant memory has reached the upper limit(tenant_id: 1002, tenant_hold: 144954195968, tenant_limit: 144955146240, alloc_size: 2097152))
observer.log.20240705125020032:[2024-07-05 12:44:39.759431] WARN common_alloc (ob_tenant_ctx_allocator.cpp:457) [149423][pnio1][T0][YB420A19F8F3-00061C4D7BCE7A88-0-0] [lt=0][errcode=-4013] No memory or reach tenant memory limit([OOPS]=“alloc failed reason”, msg=tenant memory has reached the upper limit(tenant_id: 1002, tenant_hold: 144954195968, tenant_limit: 144955146240, alloc_size: 2097152))
observer.log.20240705125020032:[2024-07-05 12:44:39.760103] WARN common_alloc (ob_tenant_ctx_allocator.cpp:457) [149417][pnio1][T0][YB420A19F8F3-00061C4D7BCE7A89-0-0] [lt=0][errcode=-4013] No memory or reach tenant memory limit([OOPS]=“alloc failed reason”, msg=tenant memory has reached the upper limit(tenant_id: 1002, tenant_hold: 144954195968, tenant_limit: 144955146240, alloc_size: 2097152))
2、内存状态正常
3、查询request_memory_used=125868913152,这么多内存
mysql> select 125868913152/1024/1024/1024 gb;
±-----------------+
| gb |
±-----------------+
| 117.224560260772 |
±-----------------+
疑问:
1、在3.1.4版本中,该SQL执行很快,在4.2.1.BP7可能是计划的原因,走的很慢.
2、该SQL执行gv$ob_sql_audit该请求,request_memory_used是指预估真的要117GB的内存?
谢谢