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

Commitbcbd940

Browse files
committed
Remove dynamic_shared_memory_type=none
PostgreSQL nowadays offers some kind of dynamic shared memory feature onall supported platforms. Having the choice of "none" prevents us fromrelying on DSM in core features. So this patch removes the choice of"none".Author: Kyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
1 parent17b715c commitbcbd940

File tree

9 files changed

+17
-48
lines changed

9 files changed

+17
-48
lines changed

‎doc/src/sgml/config.sgml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1662,9 +1662,9 @@ include_dir 'conf.d'
16621662
should use. Possible values are <literal>posix</literal> (for POSIX shared
16631663
memory allocated using <literal>shm_open</literal>), <literal>sysv</literal>
16641664
(for System V shared memory allocated via <literal>shmget</literal>),
1665-
<literal>windows</literal> (for Windows shared memory), <literal>mmap</literal>
1666-
(to simulate shared memory using memory-mapped files stored in the
1667-
data directory), and <literal>none</literal> (to disable this feature).
1665+
<literal>windows</literal> (for Windows shared memory),
1666+
and <literal>mmap</literal>(to simulate shared memory using
1667+
memory-mapped files stored in the data directory).
16681668
Not all values are supported on all platforms; the first supported
16691669
option is the default for that platform. The use of the
16701670
<literal>mmap</literal> option, which is not the default on any platform,

‎doc/src/sgml/parallel.sgml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,6 @@ EXPLAIN SELECT * FROM pgbench_accounts WHERE filler LIKE '%x%';
124124
configured via <varname>max_parallel_workers_per_gather</varname>.
125125
</para>
126126
</listitem>
127-
128-
<listitem>
129-
<para>
130-
<xref linkend="guc-dynamic-shared-memory-type"/> must be set to a
131-
value other than <literal>none</literal>. Parallel query requires dynamic
132-
shared memory in order to pass data between cooperating processes.
133-
</para>
134-
</listitem>
135127
</itemizedlist>
136128

137129
<para>

‎src/backend/access/transam/parallel.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,6 @@ CreateParallelContext(const char *library_name, const char *function_name,
161161
/* Number of workers should be non-negative. */
162162
Assert(nworkers >=0);
163163

164-
/*
165-
* If dynamic shared memory is not available, we won't be able to use
166-
* background workers.
167-
*/
168-
if (dynamic_shared_memory_type==DSM_IMPL_NONE)
169-
nworkers=0;
170-
171164
/*
172165
* If we are running under serializable isolation, we can't use parallel
173166
* workers, at least not until somebody enhances that mechanism to be

‎src/backend/optimizer/plan/planner.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,6 @@ standard_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
335335
*/
336336
if ((cursorOptions&CURSOR_OPT_PARALLEL_OK)!=0&&
337337
IsUnderPostmaster&&
338-
dynamic_shared_memory_type!=DSM_IMPL_NONE&&
339338
parse->commandType==CMD_SELECT&&
340339
!parse->hasModifyingCTE&&
341340
max_parallel_workers_per_gather>0&&
@@ -6050,8 +6049,7 @@ plan_create_index_workers(Oid tableOid, Oid indexOid)
60506049
doubleallvisfrac;
60516050

60526051
/* Return immediately when parallelism disabled */
6053-
if (dynamic_shared_memory_type==DSM_IMPL_NONE||
6054-
max_parallel_maintenance_workers==0)
6052+
if (max_parallel_maintenance_workers==0)
60556053
return0;
60566054

60576055
/* Set up largely-dummy planner state */

‎src/backend/storage/ipc/dsm.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,6 @@ dsm_postmaster_startup(PGShmemHeader *shim)
150150

151151
Assert(!IsUnderPostmaster);
152152

153-
/* If dynamic shared memory is disabled, there's nothing to do. */
154-
if (dynamic_shared_memory_type==DSM_IMPL_NONE)
155-
return;
156-
157153
/*
158154
* If we're using the mmap implementations, clean up any leftovers.
159155
* Cleanup isn't needed on Windows, and happens earlier in startup for
@@ -219,10 +215,6 @@ dsm_cleanup_using_control_segment(dsm_handle old_control_handle)
219215
uint32i;
220216
dsm_control_header*old_control;
221217

222-
/* If dynamic shared memory is disabled, there's nothing to do. */
223-
if (dynamic_shared_memory_type==DSM_IMPL_NONE)
224-
return;
225-
226218
/*
227219
* Try to attach the segment. If this fails, it probably just means that
228220
* the operating system has been rebooted and the segment no longer
@@ -391,13 +383,6 @@ dsm_postmaster_shutdown(int code, Datum arg)
391383
staticvoid
392384
dsm_backend_startup(void)
393385
{
394-
/* If dynamic shared memory is disabled, reject this. */
395-
if (dynamic_shared_memory_type==DSM_IMPL_NONE)
396-
ereport(ERROR,
397-
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
398-
errmsg("dynamic shared memory is disabled"),
399-
errhint("Set dynamic_shared_memory_type to a value other than \"none\".")));
400-
401386
#ifdefEXEC_BACKEND
402387
{
403388
void*control_address=NULL;

‎src/backend/storage/ipc/dsm_impl.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ const struct config_enum_entry dynamic_shared_memory_options[] = {
106106
#ifdefUSE_DSM_MMAP
107107
{"mmap",DSM_IMPL_MMAP, false},
108108
#endif
109-
{"none",DSM_IMPL_NONE, false},
110109
{NULL,0, false}
111110
};
112111

@@ -210,8 +209,6 @@ dsm_impl_can_resize(void)
210209
{
211210
switch (dynamic_shared_memory_type)
212211
{
213-
caseDSM_IMPL_NONE:
214-
return false;
215212
caseDSM_IMPL_POSIX:
216213
return true;
217214
caseDSM_IMPL_SYSV:

‎src/backend/utils/misc/postgresql.conf.sample

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@
133133
# sysv
134134
# windows
135135
# mmap
136-
# use none to disable dynamic shared memory
137136
# (change requires restart)
138137

139138
# - Disk -

‎src/bin/initdb/initdb.c

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,15 @@ test_config_settings(void)
984984
ok_buffers=0;
985985

986986

987+
/*
988+
* Need to determine working DSM implementation first so that subsequent
989+
* tests don't fail because DSM setting doesn't work.
990+
*/
991+
printf(_("selecting dynamic shared memory implementation ... "));
992+
fflush(stdout);
993+
dynamic_shared_memory_type=choose_dsm_implementation();
994+
printf("%s\n",dynamic_shared_memory_type);
995+
987996
printf(_("selecting default max_connections ... "));
988997
fflush(stdout);
989998

@@ -996,10 +1005,11 @@ test_config_settings(void)
9961005
"\"%s\" --boot -x0 %s "
9971006
"-c max_connections=%d "
9981007
"-c shared_buffers=%d "
999-
"-c dynamic_shared_memory_type=none "
1008+
"-c dynamic_shared_memory_type=%s "
10001009
"< \"%s\" > \"%s\" 2>&1",
10011010
backend_exec,boot_options,
10021011
test_conns,test_buffs,
1012+
dynamic_shared_memory_type,
10031013
DEVNULL,DEVNULL);
10041014
status=system(cmd);
10051015
if (status==0)
@@ -1031,10 +1041,11 @@ test_config_settings(void)
10311041
"\"%s\" --boot -x0 %s "
10321042
"-c max_connections=%d "
10331043
"-c shared_buffers=%d "
1034-
"-c dynamic_shared_memory_type=none "
1044+
"-c dynamic_shared_memory_type=%s "
10351045
"< \"%s\" > \"%s\" 2>&1",
10361046
backend_exec,boot_options,
10371047
n_connections,test_buffs,
1048+
dynamic_shared_memory_type,
10381049
DEVNULL,DEVNULL);
10391050
status=system(cmd);
10401051
if (status==0)
@@ -1046,11 +1057,6 @@ test_config_settings(void)
10461057
printf("%dMB\n", (n_buffers* (BLCKSZ /1024)) /1024);
10471058
else
10481059
printf("%dkB\n",n_buffers* (BLCKSZ /1024));
1049-
1050-
printf(_("selecting dynamic shared memory implementation ... "));
1051-
fflush(stdout);
1052-
dynamic_shared_memory_type=choose_dsm_implementation();
1053-
printf("%s\n",dynamic_shared_memory_type);
10541060
}
10551061

10561062
/*

‎src/include/storage/dsm_impl.h

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

1616
/* Dynamic shared memory implementations. */
17-
#defineDSM_IMPL_NONE0
1817
#defineDSM_IMPL_POSIX1
1918
#defineDSM_IMPL_SYSV2
2019
#defineDSM_IMPL_WINDOWS3

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp