MCPcopy Create free account
hub / github.com/apache/cloudberry / AcquireSessionState

Function AcquireSessionState

src/backend/utils/mmgr/test/redzone_handler_test.c:78–106  ·  view source on GitHub ↗

* Acquires a SessionState entry for the specified sessionid. If an existing entry * is found, this method reuses that entry */

Source from the content-addressed store, hash-verified

76 * is found, this method reuses that entry
77 */
78static SessionState *
79AcquireSessionState(int sessionId, int vmem, int activeProcessCount)
80{
81 will_be_called_count(LWLockAcquire, 1);
82 will_be_called_count(LWLockRelease, 1);
83 expect_any_count(LWLockAcquire, lock, 1);
84 expect_any_count(LWLockAcquire, mode, 1);
85 expect_any_count(LWLockRelease, lock, 1);
86
87 /* Keep the assertions happy */
88 gp_session_id = sessionId;
89 sessionStateInited = false;
90 MySessionState = NULL;
91
92 EXPECT_EREPORT(gp_sessionstate_loglevel);
93 SessionState_Init();
94
95 if (vmem >= 0)
96 {
97 MySessionState->sessionVmem = vmem;
98 }
99
100 if (activeProcessCount >= 0)
101 {
102 MySessionState->activeProcessCount = activeProcessCount;
103 }
104
105 return (SessionState *) MySessionState;
106}
107/*
108 * Checks if RedZoneHandler_ShmemInit() properly initializes the global variables
109 * as the postmaster

Calls 1

SessionState_InitFunction · 0.85

Tested by

no test coverage detected