Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit62ccdd1

Browse files
committed
First version without exhaustive testing for supporting pg_v12
1 parent1a5283c commit62ccdd1

File tree

5 files changed

+21
-13
lines changed

5 files changed

+21
-13
lines changed

‎.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ notifications:
1818
on_failure:always
1919

2020
env:
21+
-PG_VERSION=12 LEVEL=hardcore
22+
-PG_VERSION=12
2123
-PG_VERSION=11 LEVEL=hardcore
2224
-PG_VERSION=11
2325
-PG_VERSION=10 LEVEL=hardcore
@@ -28,4 +30,4 @@ env:
2830
matrix:
2931
allow_failures:
3032
-env:PG_VERSION=10 LEVEL=nightmare
31-
-env:PG_VERSION=9.6 LEVEL=nightmare
33+
-env:PG_VERSION=9.6 LEVEL=nightmare

‎Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ EXTRA_CLEAN = ./isolation_output $(EXTENSION)--$(EXTVERSION).sql \
1212
Dockerfile ./tests/*.pyc
1313

1414
ifdefUSE_PGXS
15-
PG_CONFIG = pg_config
15+
PG_CONFIG?= pg_config
1616
PGXS :=$(shell$(PG_CONFIG) --pgxs)
1717
include$(PGXS)
1818
else

‎pg_query_state.c

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ typedef struct
8888
Latch*caller;
8989
}RemoteUserIdResult;
9090

91-
staticvoidSendCurrentUserId(void);
92-
staticvoidSendBgWorkerPids(void);
91+
staticvoidSendCurrentUserId(ProcSignalReason);
92+
staticvoidSendBgWorkerPids(ProcSignalReason);
9393
staticOidGetRemoteBackendUserId(PGPROC*proc);
9494
staticList*GetRemoteBackendWorkers(PGPROC*proc);
9595
staticList*GetRemoteBackendQueryStates(PGPROC*leader,
@@ -261,7 +261,6 @@ _PG_fini(void)
261261

262262
/* clear global state */
263263
list_free(QueryDescStack);
264-
AssignCustomProcSignalHandler(QueryStatePollReason,NULL);
265264

266265
/* Uninstall hooks. */
267266
ExecutorStart_hook=prev_ExecutorStart;
@@ -605,7 +604,11 @@ pg_query_state(PG_FUNCTION_ARGS)
605604
funcctx->max_calls=max_calls;
606605

607606
/* Make tuple descriptor */
607+
#ifPG_VERSION_NUM<120000
608608
tupdesc=CreateTemplateTupleDesc(N_ATTRS, false);
609+
#else
610+
tupdesc=CreateTemplateTupleDesc(N_ATTRS);
611+
#endif
609612
TupleDescInitEntry(tupdesc, (AttrNumber)1,"pid",INT4OID,-1,0);
610613
TupleDescInitEntry(tupdesc, (AttrNumber)2,"frame_number",INT4OID,-1,0);
611614
TupleDescInitEntry(tupdesc, (AttrNumber)3,"query_text",TEXTOID,-1,0);
@@ -659,7 +662,7 @@ pg_query_state(PG_FUNCTION_ARGS)
659662
}
660663

661664
staticvoid
662-
SendCurrentUserId(void)
665+
SendCurrentUserId(ProcSignalReasonreason)
663666
{
664667
SpinLockAcquire(&counterpart_userid->mutex);
665668
counterpart_userid->userid=GetUserId();
@@ -702,7 +705,8 @@ GetRemoteBackendUserId(PGPROC *proc)
702705
#ifPG_VERSION_NUM<100000
703706
WaitLatch(MyLatch,WL_LATCH_SET,0);
704707
#else
705-
WaitLatch(MyLatch,WL_LATCH_SET,0,PG_WAIT_EXTENSION);
708+
WaitLatch(MyLatch,WL_LATCH_SET |WL_EXIT_ON_PM_DEATH,0,
709+
PG_WAIT_EXTENSION);
706710
#endif
707711
CHECK_FOR_INTERRUPTS();
708712
ResetLatch(MyLatch);
@@ -743,8 +747,9 @@ shm_mq_receive_with_timeout(shm_mq_handle *mqh,
743747
#ifPG_VERSION_NUM<100000
744748
rc=WaitLatch(MyLatch,WL_LATCH_SET |WL_TIMEOUT,delay);
745749
#else
746-
rc=WaitLatch(MyLatch,WL_LATCH_SET |WL_TIMEOUT,delay,
747-
PG_WAIT_EXTENSION);
750+
rc=WaitLatch(MyLatch,
751+
WL_LATCH_SET |WL_EXIT_ON_PM_DEATH |WL_TIMEOUT,
752+
delay,PG_WAIT_EXTENSION);
748753
#endif
749754

750755
INSTR_TIME_SET_CURRENT(cur_time);
@@ -800,7 +805,7 @@ typedef struct
800805
}BgWorkerPids;
801806

802807
staticvoid
803-
SendBgWorkerPids(void)
808+
SendBgWorkerPids(ProcSignalReasonreason)
804809
{
805810
ListCell*iter;
806811
List*all_workers=NIL;

‎pg_query_state.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include"commands/explain.h"
1616
#include"nodes/pg_list.h"
17+
#include"storage/procarray.h"
1718
#include"storage/shm_mq.h"
1819

1920
#defineQUEUE_SIZE(16 * 1024)
@@ -67,6 +68,6 @@ extern pg_qs_params *params;
6768
externshm_mq*mq;
6869

6970
/* signal_handler.c */
70-
externvoidSendQueryState(void);
71+
externvoidSendQueryState(ProcSignalReason);
7172

7273
#endif

‎signal_handler.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ serialize_stack(char *dest, List *qs_stack)
154154
* This function is called when fire custom signal QueryStatePollReason
155155
*/
156156
void
157-
SendQueryState(void)
157+
SendQueryState(ProcSignalReasonreason)
158158
{
159159
shm_mq_handle*mqh;
160160

@@ -167,7 +167,7 @@ SendQueryState(void)
167167
#ifPG_VERSION_NUM<100000
168168
WaitLatch(MyLatch,WL_LATCH_SET,0);
169169
#else
170-
WaitLatch(MyLatch,WL_LATCH_SET,0,PG_WAIT_IPC);
170+
WaitLatch(MyLatch,WL_LATCH_SET |WL_EXIT_ON_PM_DEATH,0,PG_WAIT_IPC);
171171
#endif
172172
CHECK_FOR_INTERRUPTS();
173173
ResetLatch(MyLatch);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp