sync all inner code

This commit is contained in:
openGaussDev
2022-10-27 20:21:03 +08:00
committed by yanghao
parent a10741b11e
commit f7d23913d6
520 changed files with 63136 additions and 9761 deletions

View File

@ -919,7 +919,7 @@ void StreamNodeGroup::destroy(StreamObjStatus status)
if (u_sess->stream_cxt.global_obj != NULL) {
#ifndef ENABLE_MULTIPLE_NODES
if (u_sess->stream_cxt.global_obj->m_portal != NULL) {
u_sess->stream_cxt.global_obj->m_portal->streamInfo.streamGroup = NULL;
u_sess->stream_cxt.global_obj->m_portal->streamInfo.Reset();
}
#endif
u_sess->stream_cxt.global_obj->deInit(status);
@ -952,6 +952,15 @@ void StreamNodeGroup::syncQuit(StreamObjStatus status)
u_sess->stream_cxt.enter_sync_point == true)
return;
/* add trace info while smp not correct. */
if (t_thrd.log_cxt.errordata_stack_depth == (ERRORDATA_STACK_SIZE - 1) && StreamTopConsumerAmI()) {
if (u_sess->stream_cxt.global_obj != NULL) {
ereport(LOG, (errmsg("[StreamSyncQuit] global_obj: %lu, runtime_mem_cxt: %lu",
(uint64)u_sess->stream_cxt.global_obj, (uint64)u_sess->stream_cxt.stream_runtime_mem_cxt)));
return;
}
}
/* We must relase all pthread mutex by my thread, Or it will dead lock. But it is not a good solution. */
// lock the same thread mutex can't be conflict in one thread.
ResourceOwnerReleaseAllXactPthreadMutex();
@ -1012,14 +1021,14 @@ void StreamNodeGroup::syncQuit(StreamObjStatus status)
pgstat_report_waitstatus(oldStatus);
}
void StreamNodeGroup::ReleaseStreamGroup(bool resetSession)
void StreamNodeGroup::ReleaseStreamGroup(bool resetSession, StreamObjStatus status)
{
if (u_sess->stream_cxt.global_obj != NULL) {
StreamTopConsumerIam();
/* Set sync point for waiting all stream threads complete. */
StreamNodeGroup::syncQuit(STREAM_COMPLETE);
StreamNodeGroup::syncQuit(status);
UnRegisterStreamSnapshots();
StreamNodeGroup::destroy(STREAM_COMPLETE);
StreamNodeGroup::destroy(status);
if (!resetSession) {
/* reset some flag related to stream */
ResetStreamEnv();