修復啟動流程走異常恢復

2022-09-29 15:24:13 字數 980 閱讀 6154

【問題描述】

寫入unlogged表,gs_ctl正常停程序後,啟動程序,資料丟失,和開源pg不一致

【問題定位】

1)啟動讀值資料錯導致走recovery流程

checkpoint.redo=decoder->main_data

recptr=checkpointloc = t_thrd.shemem_ptr_cxt.controlfile->checkpoint;

if (xlbytelt(checkpoint.redo, recptr)) 

recovery=true #xlog.cppl9893

2)停程序前這兩個字段為什麼不相等

createcheckpoint更新時序

a)checkpoint.redo = curminreclsn

b)寫兩行standby的xlog,#開源沒有這兩個,導致c裡的值變大

c)t_thrd.shemem_ptr_cxt.controlfile->checkpoint = t_thrd.xlog_cxt.proclastrecptr;

【修復方法】

1)把上面的兩行xlog提前到a前面

2)必須放在startsuspendwalinsert前,不然寫不了

【測試效果】

1)停程序前插入資料

create unlogged table test(n int,n1 int);

create table

opengauss=# insert into test(n, n1) values(1,1);

insert 0 1

opengauss=# select * from test;

n | n1

---+----

1 | 1

(1 row)

2)啟動後資料還在

修復Ubuntu啟動

修復ubuntu啟動 要修復grub的第一件事就是想辦法進入grub。如果有ubuntu的livecd很簡單,用livecd啟動電腦,然後進入終端直接執行grub就可以進入grub指令狀態。進入ubuntu系統桌面,在終端輸入命令 紅色 字型為輸入的命令,輸入命令後按 回車 鍵確定,藍色 為輸入命令...

ubuntu 啟動修復

sudo fdisk l 注意是小寫的l,不是數字的1 找到 dev sda6 5852 8323 19856308 b w95 fat32 dev sda7 8324 9598 10241406 83 linux dev sda8 9599 9729 1052226 82 linux swap s...

修復Ubuntu啟動

修復ubuntu啟動 要修復grub的第一件事就是想辦法進入grub。如果有ubuntu的livecd很簡單,用livecd啟動電腦,然後進入終端直接執行grub就可以進入grub指令狀態。進入ubuntu系統桌面,在終端輸入命令 紅色字型為輸入的命令,輸入命令後按 回車 鍵確定,藍色為輸入命令顯示...