1.解决主机新加段页式文件,备机更新时没有初始化的问题
2.解决debug模式下cm_agent由于u_sess上的globalxmin是无效值,导致异常的问题 3.解决主机drop db/drop tablespace,广播到备机后,备机mes如果异常退出,不释放锁的问题
This commit is contained in:
@ -102,6 +102,10 @@ Snapshot SSGetSnapshotData(Snapshot snapshot)
|
||||
/* For cm agent, it only query the system status using the parameter in memory. So don't need MVCC */
|
||||
if (u_sess->libpq_cxt.IsConnFromCmAgent) {
|
||||
snapshot = SnapshotNow;
|
||||
if (!TransactionIdIsNormal(u_sess->utils_cxt.RecentGlobalXmin)) {
|
||||
u_sess->utils_cxt.RecentGlobalXmin = FirstNormalTransactionId;
|
||||
}
|
||||
u_sess->utils_cxt.RecentGlobalDataXmin = u_sess->utils_cxt.RecentGlobalXmin;
|
||||
return snapshot;
|
||||
}
|
||||
|
||||
|
||||
@ -155,6 +155,11 @@ bool df_ss_update_segfile_size(SegLogicFile *sf, BlockNumber target_block)
|
||||
}
|
||||
|
||||
uint32 flags = O_RDWR | PG_BINARY;
|
||||
/* need palloc segfiles if file_num is 0 */
|
||||
if (sf->vector_capacity == 0) {
|
||||
df_extend_file_vector(sf);
|
||||
}
|
||||
|
||||
if (sf->file_num == 0) {
|
||||
char *filename = slice_filename(sf->filename, 0);
|
||||
int fd = dv_open_file(filename, flags, (int)SEGMENT_FILE_MODE);
|
||||
|
||||
@ -413,19 +413,22 @@ static void SSClose_seg_files(SegSpace *spc)
|
||||
|
||||
void SSDrop_seg_space(Oid spcNode, Oid dbNode)
|
||||
{
|
||||
SegSpace *spc = spc_init_space_node(spcNode, dbNode);
|
||||
AutoMutexLock spc_lock(&spc->lock);
|
||||
SegSpace *entry = NULL;
|
||||
AutoMutexLock spc_lock(&segspace_lock);
|
||||
SegSpcTag tag = {.spcNode = spcNode, .dbNode = dbNode};
|
||||
SegmentCheck(t_thrd.storage_cxt.SegSpcCache != NULL);
|
||||
spc_lock.lock();
|
||||
|
||||
SpaceDataFileStatus dataStatus = spc_status(spc);
|
||||
if (dataStatus == SpaceDataFileStatus::EMPTY) {
|
||||
spc_lock.unLock();
|
||||
return;
|
||||
}
|
||||
|
||||
SegDropSpaceMetaBuffers(spcNode, dbNode);
|
||||
SSClose_seg_files(spc);
|
||||
entry = (SegSpace *)hash_search(t_thrd.storage_cxt.SegSpcCache, (void *)&tag, HASH_FIND, NULL);
|
||||
spc_lock.unLock();
|
||||
|
||||
if (entry != NULL) {
|
||||
if(entry->status == OPENED) {
|
||||
SSClose_seg_files(entry);
|
||||
SegDropSpaceMetaBuffers(spcNode, dbNode);
|
||||
}
|
||||
spc_lock.lock();
|
||||
(void)hash_search(t_thrd.storage_cxt.SegSpcCache, (void *)&tag, HASH_REMOVE, NULL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user