?一、版本信息
名稱 | 值 |
CPU | Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz |
操作系統(tǒng) | CentOS Linux release 7.9.2009 (Core) |
內(nèi)存 | 3G |
邏輯核數(shù) | 2 |
Gbase8a版本 | 8.6.2-R43 |
二、問(wèn)題原因
由于gbase.table_distribution存儲(chǔ)了所有引擎為express的表元數(shù)據(jù)信息,如果此表出現(xiàn)數(shù)據(jù)損壞,會(huì)導(dǎo)致本地調(diào)度節(jié)點(diǎn)無(wú)法獲取表信息,在select、drop等操作時(shí),將提示metadata is incomplete on localhost。但desc、show create table語(yǔ)句還是可以執(zhí)行成功的。
三、gbase.table_distribution介紹
gbase> select index_name,dbName,tbName,isReplicate,hash_column,is_nocopies,data_distribution_id from gbase.table_distribution limit 10;
+-------------------------------+------------+--------------------+-------------+-------------+-------------+----------------------+
| index_name | dbName | tbName | isReplicate | hash_column | is_nocopies | data_distribution_id |
+-------------------------------+------------+--------------------+-------------+-------------+-------------+----------------------+
| gclusterdb.nodedatamap | gclusterdb | nodedatamap | YES | NULL | NO | 1 |
| gclusterdb.rebalancing_status | gclusterdb | rebalancing_status | NO | index_name | NO | 1 |
| gclusterdb.dual | gclusterdb | dual | YES | NULL | NO | 1 |
| czg.hash_tb_like | czg | hash_tb_like | NO | NULL | NO | 1 |
| czg.testtab | czg | testtab | NO | NULL | NO | 1 |
| czg.a | czg | a | NO | NULL | NO | 1 |
| czg.b | czg | b | NO | NULL | NO | 1 |
| czg.testtab_copy | czg | testtab_copy | NO | NULL | NO | 1 |
| czg.test_table | czg | test_table | NO | NULL | NO | 1 |
| czg.test_table_1 | czg | test_table_1 | NO | NULL | NO | 1 |
+-------------------------------+------------+--------------------+-------------+-------------+-------------+----------------------+
10 rows in set (Elapsed: 00:00:00.00)
列名 | 含義 |
index_name | 庫(kù)名和表名組合,主鍵的作用。 |
dbName | 庫(kù)名。 |
tbName | 表名。 |
isReplicate | 復(fù)制表的標(biāo)記。 |
hash_column | 哈希分布表數(shù)據(jù)分布列。 |
is_nocopies | nocopy表的標(biāo)記。 |
data_distribution_id | 表數(shù)據(jù)分部信息的 ID。 |
四、解決方法
1、多調(diào)度節(jié)點(diǎn)
我這邊是出現(xiàn)了一個(gè)是一個(gè)DDL EVENT,查看gc_recover.log過(guò)一段時(shí)間會(huì)自動(dòng)修復(fù)DDL EVENT。
?如果沒(méi)有立馬恢復(fù),例如你查的是一節(jié)點(diǎn)出的錯(cuò)誤,可以換到二節(jié)點(diǎn),也可以正常查詢,因?yàn)槎?jié)點(diǎn)的gbase.table_distribution元數(shù)據(jù)沒(méi)有損壞。
2、一個(gè)調(diào)度節(jié)點(diǎn)
一個(gè)調(diào)度節(jié)點(diǎn)無(wú)法自動(dòng)修復(fù),只能手動(dòng)刪除相應(yīng)event,我這邊是DDLevent,所以用下面方法,其他的event要調(diào)用相應(yīng)的方法。文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-463229.html
我們先查看存在哪些ddl event,調(diào)用gcware.getddlfevents()獲取。文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-463229.html
[gbase@czg2 Graph]$ python
Python 2.7.5 (default, Jun 28 2022, 15:30:04)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gcware
>>> gcware.getddlfevents()
({'eventid': 3, 'comment': '', 'distributionid': 1, 'tablename':
'test.t', 'delayTag': 0, 'content':
'\x01\x00\x02\x00\x01\x00\x02\x00\xe9\x00\x00\x00\xd2\x05\x00test\x0
0\x02\x00t\x00\x01\x00\x03\x00b\xc0\xa8\x06\xe8\x16\x00\x01\x00\x12\
x19\x07\x00\x00\x19\x00\x11\x02\x19\x00\x17\x03\x15\x00\x07\x1d\x00\
x00\x1b\x00S\x02\x00\x00\x00\x180\x00\x07\x1b\x00\xf3\x93\x9e\x00\x0
0\x00CREATE GCLUSTER_LOCAL TABLE /*+ sub_step,distribution(1) */
"test"."TNAME_00-1D-7D-C7-A5-17" (\n"a" INT(11) DEFAULT NULL\n)
TID_00-1D-7D-C7-A5-17 UID(1)
\x00\xb4\x00\x90\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'tableid': 22,
'datacopyids': ({'segid': 3, 'nodeipaddr': '192.168.6.232', 'nodeid':
3892750528, 'segname': 'n3'}, {'segid': 2, 'nodeipaddr':
'192.168.6.232', 'nodeid': 3892750528, 'segname': 'n2'}),
'nodecopyids': ({'nodeipaddr': '192.168.6.232', 'nodeid':
3892750528},), 'tabletype': 'DISTRIBUTION'},)
clearddlfevent(regex)介紹點(diǎn) | 描述 |
實(shí)現(xiàn)功能 | 將符合正則表達(dá)式條件的表名對(duì)應(yīng)的 ddl event 清除掉。 |
參數(shù) | regex:用正則表達(dá)式描述的表名。 |
返回值 | 被刪除的 event 個(gè)數(shù)。 |
>>> gcware.clearddlfevent('test.t')
1
到了這里,關(guān)于南大通用數(shù)據(jù)庫(kù)-Gbase-8a-報(bào)錯(cuò)集錦-02-metadata is incomplete on localhost的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!