调整部分校验与初始化逻辑
This commit is contained in:
@ -3927,14 +3927,14 @@ static void parse_vgname_args(char* args)
|
||||
vgname = xstrdup(args);
|
||||
enable_dss = true;
|
||||
if (strstr(vgname, "/") != NULL) {
|
||||
fprintf(stderr, "invalid token \"/\" in vgname");
|
||||
fprintf(stderr, "invalid token \"/\" in vgname\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
char *comma = strstr(vgname, ",");
|
||||
if (comma == NULL) {
|
||||
vgdata = vgname;
|
||||
vglog = (char *)"";
|
||||
vglog = vgname;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -3942,11 +3942,7 @@ static void parse_vgname_args(char* args)
|
||||
comma = strstr(vgdata, ",");
|
||||
comma[0] = '\0';
|
||||
vglog = comma + 1;
|
||||
if (strstr(vgdata, ",") != NULL) {
|
||||
fprintf(stderr, "invalid vgname args, should be two volume group names, example: \"+data,+log\"");
|
||||
exit(1);
|
||||
}
|
||||
if (strstr(vglog, ",") != NULL) {
|
||||
if (strstr(vgdata, ",") != NULL || strstr(vglog, ",") != NULL) {
|
||||
fprintf(stderr, "invalid vgname args, should be two volume group names, example: \"+data,+log\"");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@ -1657,6 +1657,23 @@ static void incre_ckpt_aio_callback(struct io_event *event)
|
||||
_exit(0);
|
||||
}
|
||||
|
||||
off_t roffset = 0;
|
||||
if (IsSegmentBufferID(buf_desc->buf_id)) {
|
||||
roffset = ((buf_desc->tag.blockNum) % RELSEG_SIZE) * BLCKSZ;
|
||||
} else {
|
||||
roffset = ((buf_desc->extra->seg_blockno) % RELSEG_SIZE) * BLCKSZ;
|
||||
}
|
||||
|
||||
int aioRet = dss_aio_post_pwrite(event->obj->data, tempAioExtra->aio_fd, event->obj->u.c.nbytes, roffset);
|
||||
if (aioRet != 0) {
|
||||
ereport(PANIC, (errmsg("failed to post write by asnyc io (errno = %d), buffer: %d/%d/%d/%d/%d %d-%d", errno,
|
||||
buf_desc->tag.rnode.spcNode, buf_desc->tag.rnode.dbNode, buf_desc->tag.rnode.relNode,
|
||||
(int32)buf_desc->tag.rnode.bucketNode, (int32)buf_desc->tag.rnode.opt,
|
||||
buf_desc->tag.forkNum, buf_desc->tag.blockNum)));
|
||||
}
|
||||
|
||||
buf_desc->extra->aio_in_progress = false;
|
||||
|
||||
#ifdef USE_ASSERT_CHECKING
|
||||
char *write_buf = (char *)(event->obj->u.c.buf);
|
||||
char *origin_buf = (char *)palloc(BLCKSZ + ALIGNOF_BUFFER);
|
||||
@ -1669,10 +1686,9 @@ static void incre_ckpt_aio_callback(struct io_event *event)
|
||||
buf_desc->extra->seg_fileno, buf_desc->tag.forkNum,
|
||||
buf_desc->extra->seg_blockno, (char *)read_buf);
|
||||
}
|
||||
|
||||
if (XLByteEQ(PageGetLSN(read_buf), PageGetLSN(write_buf))) {
|
||||
Assert(memcmp(write_buf, read_buf, BLCKSZ) == 0);
|
||||
} else if (XLByteLT(PageGetLSN(read_buf), PageGetLSN(write_buf))) {
|
||||
} else if (!PageIsNew(read_buf) && XLByteLT(PageGetLSN(read_buf), PageGetLSN(write_buf))) {
|
||||
ereport(PANIC, (errmsg("[SS][%d/%d/%d/%d/%d %d-%d]aio write error",
|
||||
buf_desc->tag.rnode.spcNode, buf_desc->tag.rnode.dbNode, buf_desc->tag.rnode.relNode,
|
||||
(int32)buf_desc->tag.rnode.bucketNode, (int32)buf_desc->tag.rnode.opt,
|
||||
@ -1691,22 +1707,6 @@ static void incre_ckpt_aio_callback(struct io_event *event)
|
||||
pfree(origin_buf);
|
||||
#endif
|
||||
|
||||
off_t roffset = 0;
|
||||
if (IsSegmentBufferID(buf_desc->buf_id)) {
|
||||
roffset = ((buf_desc->tag.blockNum) % RELSEG_SIZE) * BLCKSZ;
|
||||
} else {
|
||||
roffset = ((buf_desc->extra->seg_blockno) % RELSEG_SIZE) * BLCKSZ;
|
||||
}
|
||||
|
||||
int aioRet = dss_aio_post_pwrite(event->obj->data, tempAioExtra->aio_fd, event->obj->u.c.nbytes, roffset);
|
||||
if (aioRet != 0) {
|
||||
ereport(PANIC, (errmsg("failed to post write by asnyc io (errno = %d), buffer: %d/%d/%d/%d/%d %d-%d", errno,
|
||||
buf_desc->tag.rnode.spcNode, buf_desc->tag.rnode.dbNode, buf_desc->tag.rnode.relNode,
|
||||
(int32)buf_desc->tag.rnode.bucketNode, (int32)buf_desc->tag.rnode.opt,
|
||||
buf_desc->tag.forkNum, buf_desc->tag.blockNum)));
|
||||
}
|
||||
|
||||
buf_desc->extra->aio_in_progress = false;
|
||||
UnpinBuffer(buf_desc, true);
|
||||
}
|
||||
|
||||
|
||||
@ -323,7 +323,7 @@ void SegFlushCheckDiskLSN(SegSpace *spc, RelFileNode rNode, ForkNumber forknum,
|
||||
BufferDesc *buf_desc, char *buf)
|
||||
{
|
||||
#ifndef USE_ASSERT_CHECKING
|
||||
if (!IsInitdb && !RecoveryInProgress() && !SS_IN_ONDEMAND_RECOVERY && ENABLE_DSS &&
|
||||
if (!RecoveryInProgress() && !SS_IN_ONDEMAND_RECOVERY && ENABLE_DMS &&
|
||||
!SS_DISASTER_STANDBY_CLUSTER && !g_instance.dms_cxt.SSRecoveryInfo.disaster_cluster_promoting) {
|
||||
dms_buf_ctrl_t *buf_ctrl = GetDmsBufCtrl(buf_desc->buf_id);
|
||||
XLogRecPtr lsn_on_mem = PageGetLSN(buf);
|
||||
@ -336,7 +336,7 @@ void SegFlushCheckDiskLSN(SegSpace *spc, RelFileNode rNode, ForkNumber forknum,
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (!RecoveryInProgress() && !SS_IN_ONDEMAND_RECOVERY && ENABLE_DSS && ENABLE_VERIFY_PAGE_VERSION &&
|
||||
if (!RecoveryInProgress() && !SS_IN_ONDEMAND_RECOVERY && ENABLE_DMS && ENABLE_VERIFY_PAGE_VERSION &&
|
||||
!SS_DISASTER_STANDBY_CLUSTER && !g_instance.dms_cxt.SSRecoveryInfo.disaster_cluster_promoting) {
|
||||
char *origin_buf = (char *)palloc(BLCKSZ + ALIGNOF_BUFFER);
|
||||
char *temp_buf = (char *)BUFFERALIGN(origin_buf);
|
||||
|
||||
Reference in New Issue
Block a user