!1086 同步[PR 1085 PR 1061] 到2.0分支

Merge pull request !1086 from cchen676/new2.0
This commit is contained in:
opengauss-bot 2021-07-21 09:46:05 +00:00 committed by Gitee
commit 4cae2a598f
2 changed files with 12 additions and 2 deletions

View File

@ -1803,9 +1803,19 @@ bool dw_single_file_recycle(bool trunc_file)
bool dw_verify_item(const dw_single_flush_item* item, uint16 dwn)
{
if (item->data_page_idx == 0 || item->dwn != dwn) {
if (item->dwn != dwn) {
return false;
}
if (item->buf_tag.forkNum == InvalidForkNumber || item->buf_tag.blockNum == InvalidBlockNumber ||
item->buf_tag.rnode.relNode == InvalidOid) {
ereport(DEBUG1,
(errmsg("dw recovery, find invalid item [page_idx %hu dwn %hu] skip this item,"
"buf_tag[rel %u/%u/%u blk %u fork %d]", item->data_page_idx, item->dwn,
item->buf_tag.rnode.spcNode, item->buf_tag.rnode.dbNode, item->buf_tag.rnode.relNode,
item->buf_tag.blockNum, item->buf_tag.forkNum)));
return false;
}
pg_crc32c crc;
/* Contents are protected with a CRC */
INIT_CRC32C(crc);

View File

@ -1795,7 +1795,7 @@ bool cmdStringCheck(const char *cmd_string)
* */
static bool cmdStringLengthCheck(const char* cmd_string)
{
const size_t cmd_length_limit = 1024;
const size_t cmd_length_limit = 102400;
const size_t slotname_limit = 64;
char comd[cmd_length_limit] = {'\0'};
char* sub_cmd = NULL;