How to Check if the Database is in Restricted Mode.
search cancel

How to Check if the Database is in Restricted Mode.

book

Article ID: 295803

calendar_today

Updated On:

Products

VMware Tanzu Greenplum

Issue/Introduction

This article provides a simple tip and various method to help identify whether the database is in restricted mode.

 


Environment


Resolution

Option 1

Verify database startup log under gpAdminLogs directory on most recent gpstart_yyyymmdd.log. Below is the startup log on both normal and restricted mode.

  • Restricted mode startup log:

Note: The indication of "RESTRICTED mode" keyword on the log.

cat /home/gpadmin/gpAdminLogs/gpstart_20130418.log
20130418:10:34:45:010414 gpstart:mdw:gpadmin-[INFO]:-Starting gpstart with args: -R
[.......]
[.......]
20130418:10:34:54:010414 gpstart:mdw:gpadmin-[INFO]:-Successfully started 8 of 8 segment instances
20130418:10:34:54:010414 gpstart:mdw:gpadmin-[INFO]:-----------------------------------------------------
20130418:10:34:54:010414 gpstart:mdw:gpadmin-[INFO]:-Starting Master instance mdw directory /data/master/gp42t/gp-1 in RESTRICTED mode
20130418:10:34:55:010414 gpstart:mdw:gpadmin-[INFO]:-Command pg_ctl reports Master mdw instance active
20130418:10:34:55:010414 gpstart:mdw:gpadmin-[INFO]:-Database successfully started
20130418:10:34:55:010414 gpstart:mdw:gpadmin-[INFO]:-Initializing DCA settings
20130418:10:34:55:010414 gpstart:mdw:gpadmin-[INFO]:-DCA settings initialize
  • Normal mode startup log:
    cat /home/gpadmin/gpAdminLogs/gpstart_20130418.log
    20130418:10:37:12:016497 gpstart:mdw:gpadmin-[INFO]:-Starting gpstart with args: -a
    [.......]
    [.......]
    20130418:10:37:20:016497 gpstart:mdw:gpadmin-[INFO]:-Successfully started 8 of 8 segment instances
    20130418:10:37:20:016497 gpstart:mdw:gpadmin-[INFO]:-----------------------------------------------------
    20130418:10:37:20:016497 gpstart:mdw:gpadmin-[INFO]:-Starting Master instance mdw directory /data/master/gp42t/gp-1
    20130418:10:37:21:016497 gpstart:mdw:gpadmin-[INFO]:-Command pg_ctl reports Master mdw instance active
    20130418:10:37:21:016497 gpstart:mdw:gpadmin-[INFO]:-Database successfully started
    20130418:10:37:21:016497 gpstart:mdw:gpadmin-[INFO]:-Initializing DCA settings
    20130418:10:37:21:016497 gpstart:mdw:gpadmin-[INFO]:-DCA settings initialized

Option 2

If you want to do it within a database session, you will usually see "superuser_reserved_connections" maxed out to 250:

  • Normal start:
    test=# show max_connections; show superuser_reserved_connections ;
    max_connections
    -----------------
    250
    (1 row)
    
    superuser_reserved_connections
    --------------------------------
    3
    (1 row)
  • Restricted mode start:
    test=# show max_connections; show superuser_reserved_connections ;
    max_connections
    -----------------
    250
    (1 row)
     
    superuser_reserved_connections
    --------------------------------
    250
    (1 row)

Option 3

You can also find out the similar information as indicated in step 2 from the process (ps) command:

  • Normal start:
    [gpadmin@mdw kamal]$ pgrep -fl silent
    31541 /usr/local/GP-4.2.3.2/bin/postgres -D /data/master/kumlik_4232_gpseg-1 -p 9002 -b 1 -z 24 --silent-mode=true -i -M master -C -1 -x 0 -E
    [gpadmin@mdw kamal]$
  • Restricted mode start:
    [gpadmin@mdw kamal]$ pgrep -fl silent
    20326 /usr/local/GP-4.2.3.2/bin/postgres -D /data/master/kumlik_4232_gpseg-1 -p 9002 -b 1 -z 24 --silent-mode=true -i -M master -C -1 -x 0 -E -c superuser_reserved_connections=250
    [gpadmin@mdw kamal]$

Option 4

From the postmaster file, the restricted postmaster.opts files shows

[gpadmin@mdw gpseg-1]$ cat $MASTER_DATA_DIRECTORY/postmaster.opts
/data/#####/greenplum-db-4.2.0.0/bin/postgres "-D" "/data/#####/greenplum-db-4.2.0.0-master/gpseg-1" "-E" "-i" "-M" "master" "-p" "5438" "-b" "1" "-x" "6" "-C" "-1" "-z" "2" "--silent-mode=true" "-c" "superuser_reserved_connections=250"



Additional Information