On 26.06.18 09:10, Kyotaro HORIGUCHI wrote:
> --- a/src/bin/initdb/initdb.c
> +++ b/src/bin/initdb/initdb.c
> @@ -984,6 +984,16 @@ test_config_settings(void)
>                               ok_buffers = 0;
>  
>  
> +     /*
> +      * Server doesn't confirm that the server-default DSM implementation is
> +      * actually workable. Choose a fine one for probing then it is used on 
> the
> +      * new database.
> +      */
> +     printf(_("selecting dynamic shared memory implementation ... "));
> +     fflush(stdout);
> +     dynamic_shared_memory_type = choose_dsm_implementation();
> +     printf("%s\n", dynamic_shared_memory_type);
> +
>       printf(_("selecting default max_connections ... "));
>       fflush(stdout);
>  

I don't understand that comment.  initdb does test whether dsm=posix
works.  What more were you hoping for?

> @@ -996,10 +1006,11 @@ test_config_settings(void)
>                                "\"%s\" --boot -x0 %s "
>                                "-c max_connections=%d "
>                                "-c shared_buffers=%d "
> -                              "-c dynamic_shared_memory_type=none "
> +                              "-c dynamic_shared_memory_type=%s "
>                                "< \"%s\" > \"%s\" 2>&1",
>                                backend_exec, boot_options,
>                                test_conns, test_buffs,
> +                              dynamic_shared_memory_type,
>                                DEVNULL, DEVNULL);
>               status = system(cmd);
>               if (status == 0)

We could perhaps avoid some variability here by running the
bootstrapping runs in initdb using hardcoded dsm settings of
"sysv"/"windows".

> --- a/src/include/storage/dsm_impl.h
> +++ b/src/include/storage/dsm_impl.h
> @@ -14,11 +14,10 @@
>  #define DSM_IMPL_H
>  
>  /* Dynamic shared memory implementations. */
> -#define DSM_IMPL_NONE                        0
> -#define DSM_IMPL_POSIX                       1
> -#define DSM_IMPL_SYSV                        2
> -#define DSM_IMPL_WINDOWS             3
> -#define DSM_IMPL_MMAP                        4
> +#define DSM_IMPL_POSIX                       0
> +#define DSM_IMPL_SYSV                        1
> +#define DSM_IMPL_WINDOWS             2
> +#define DSM_IMPL_MMAP                        3

I would avoid renumbering here.  It was kind of sensible to have NONE =
0, so I'd keep the non-NONE ones as non-zero.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Reply via email to