This is an automated email from the ASF dual-hosted git repository.

avamingli pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit e3bbfda9a88113581e464e4611e354d4ef80015f
Author: Soumyadeep Chakraborty <[email protected]>
AuthorDate: Wed Apr 3 10:28:40 2024 -0700

    Default to log_checkpoints=on, log_autovacuum_min_duration=10m
    
    Backported from upstream commit:
    64da07c41a8c0a680460cdafc79093736332b6cf
    with one important difference: we didn't absorb the
    log_autovacuum_min_duration change. This is because in GPDB, autovacuum
    driven autoanalyze can take longer due to the size of GPDB tables (and
    also analyze is dispatched from the QD). So, we decide to be
    conservative about that change.
    
    Original commit message follows:
    
    The idea here is that when a performance problem is known to have
    occurred at a certain point in time, it's a good thing if there is
    some information available from the logs to help figure out what
    might have happened around that time.
    
    This change attracted an above-average amount of dissent, because
    it means that a server with default settings will produce some amount
    of log output even if nothing has gone wrong. However, by my count,
    the mailing list discussion had about twice as many people in favor
    of the change as opposed. The reasons for believing that the extra
    log output is not an issue in practice are: (1) the rate at which
    messages can be generated by this setting is bounded to one every
    few minutes on a properly-configured system and (2) production
    systems tend to have a lot more junk in the log from that due to
    failed connection attempts, ERROR messages generated by application
    activity, and the like.
    
    Bharath Rupireddy, reviewed by Fujii Masao and by me. Many other
    people commented on the thread, but as far as I can see that was
    discussion of the merits of the change rather than review of the
    patch.
    
    Discussion: 
https://postgr.es/m/calj2acx-rw_oedcp4gqrfuakf1f50fnh138dmkd0jkvcnqr...@mail.gmail.com
    
    Reviewed-by: Marbin Tan <[email protected]>
---
 src/backend/access/transam/xlog.c             | 2 +-
 src/backend/utils/misc/guc.c                  | 2 +-
 src/backend/utils/misc/postgresql.conf.sample | 2 +-
 src/bin/initdb/initdb.c                       | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/backend/access/transam/xlog.c 
b/src/backend/access/transam/xlog.c
index 87853dcafe..3a850556ef 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -122,7 +122,7 @@ char           *wal_consistency_checking_string = NULL;
 bool      *wal_consistency_checking = NULL;
 bool           wal_init_zero = true;
 bool           wal_recycle = true;
-bool           log_checkpoints = false;
+bool           log_checkpoints = true;
 int                    sync_method = DEFAULT_SYNC_METHOD;
 int                    wal_level = WAL_LEVEL_MINIMAL;
 int                    CommitDelay = 0;        /* precommit delay in 
microseconds */
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 5329f55e3c..1f8c6019b6 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -1417,7 +1417,7 @@ static struct config_bool ConfigureNamesBool[] =
                        NULL
                },
                &log_checkpoints,
-               false,
+               true,
                NULL, NULL, NULL
        },
        {
diff --git a/src/backend/utils/misc/postgresql.conf.sample 
b/src/backend/utils/misc/postgresql.conf.sample
index 31ac67628a..98db5c5635 100644
--- a/src/backend/utils/misc/postgresql.conf.sample
+++ b/src/backend/utils/misc/postgresql.conf.sample
@@ -547,7 +547,7 @@ optimizer_analyze_root_partition = on # stats collection on 
root partitions
                                        # their durations, > 0 logs only
                                        # actions running at least this number
                                        # of milliseconds.
-#log_checkpoints = off
+#log_checkpoints = on
 #log_connections = off
 #log_disconnections = off
 #log_duration = off
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index dd35309652..4b997df45f 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -212,8 +212,8 @@ static bool authwarning = false;
  * but here it is more convenient to pass it as an environment variable
  * (no quoting to worry about).
  */
-static const char *boot_options = "-F";
-static const char *backend_options = "--single -F -O -j -c gp_role=utility -c 
search_path=pg_catalog -c exit_on_error=true";
+static const char *boot_options = "-F -c log_checkpoints=false";
+static const char *backend_options = "--single -F -O -j -c gp_role=utility -c 
search_path=pg_catalog -c exit_on_error=true -c log_checkpoints=false";
 
 /* Additional switches to pass to backend (either boot or standalone) */
 static char *extra_options = "";


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to