PostgreSQL Source Code: src/backend/storage/ipc/sinval.c Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
16
22
23
25
26
27
28
29
30
31
32
33
34
35
36
37
38
40
41
42
43
44
45
46void
48{
50}
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68void
70 void (*resetFunction) (void))
71{
72#define MAXINVALMSGS 32
74
75
76
77
78
79 static volatile int nextmsg = 0;
80 static volatile int nummsgs = 0;
81
82
83 while (nextmsg < nummsgs)
84 {
86
88 invalFunction(&msg);
89 }
90
91 do
92 {
93 int getResult;
94
95 nextmsg = nummsgs = 0;
96
97
99
100 if (getResult < 0)
101 {
102
105 resetFunction();
106 break;
107 }
108
109
110 nextmsg = 0;
111 nummsgs = getResult;
112
113 while (nextmsg < nummsgs)
114 {
116
118 invalFunction(&msg);
119 }
120
121
122
123
124
126
127
128
129
130
131
132
133
134
136 {
138 elog(DEBUG4, "sinval catchup complete, cleaning queue");
140 }
141}
142
143
144
145
146
147
148
149
150
151
152
153void
155{
156
157
158
159
160
162
163
165}
166
167
168
169
170
171
172
173void
175{
177 {
178
179
180
181
182
183
184
185
186
187
188
189
190
192 {
193 elog(DEBUG4, "ProcessCatchupEvent inside transaction");
195 }
196 else
197 {
198 elog(DEBUG4, "ProcessCatchupEvent outside transaction");
201 }
202 }
203}
void AcceptInvalidationMessages(void)
void SetLatch(Latch *latch)
void HandleCatchupInterrupt(void)
void SendSharedInvalidMessages(const SharedInvalidationMessage *msgs, int n)
void ReceiveSharedInvalidMessages(void(*invalFunction)(SharedInvalidationMessage *msg), void(*resetFunction)(void))
void ProcessCatchupInterrupt(void)
volatile sig_atomic_t catchupInterruptPending
uint64 SharedInvalidMessageCounter
void SICleanupQueue(bool callerHasWriteLock, int minFree)
int SIGetDataEntries(SharedInvalidationMessage *data, int datasize)
void SIInsertDataEntries(const SharedInvalidationMessage *data, int n)
bool IsTransactionOrTransactionBlock(void)
void StartTransactionCommand(void)
void CommitTransactionCommand(void)