Skip to content

Commit

Permalink
change warning messages. move size adding of quota_info_map to diskqu…
Browse files Browse the repository at this point in the history
…ota_worker_shmem_size
  • Loading branch information
KnightMurloc committed Dec 26, 2023
1 parent a26964f commit a84787d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/diskquota_utility.c
Original file line number Diff line number Diff line change
Expand Up @@ -1702,7 +1702,7 @@ check_hash_fullness(HTAB *hashp, int max_size, const char *warning_message, Time
if (*last_overflow_report == 0 || TimestampDifferenceExceeds(*last_overflow_report, current_time,
diskquota_hashmap_overflow_report_timeout * 1000))
{
ereport(WARNING, (errmsg("%s", warning_message)));
ereport(WARNING, (errmsg("[diskquota] %s", warning_message)));
*last_overflow_report = current_time;
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/gp_activetable.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ typedef struct DiskQuotaSetOFCache
static HTAB *active_tables_map = NULL; // Set<DiskQuotaActiveTableFileEntry>
TimestampTz active_tables_map_last_overflow_report = 0;

#define ACTIVE_TABLES_MAP_WARNING \
"[diskquota] the number of active tables reached the limit, please increase " \
#define ACTIVE_TABLES_MAP_WARNING \
"the number of active tables reached the limit, please increase " \
"the GUC value for diskquota.max_active_tables."

/*
Expand All @@ -68,8 +68,8 @@ TimestampTz active_tables_map_last_overflow_report = 0;
static HTAB *altered_reloid_cache = NULL; // Set<Oid>
static TimestampTz altered_reloid_cache_last_overflow_report = 0;

#define ALTERED_RELOID_CACHE_WARNING \
"[diskquota] the number of altered reloid cache entries reached the limit, please increase " \
#define ALTERED_RELOID_CACHE_WARNING \
"the number of altered reloid cache entries reached the limit, please increase " \
"the GUC value for diskquota.max_active_tables."

/* active table hooks which detect the disk file size change. */
Expand Down
19 changes: 9 additions & 10 deletions src/quotamodel.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ static HTAB *quota_info_map;
/* stored in shared memory */
static TimestampTz *quota_info_map_last_overflow_report = NULL;

#define QUOTA_INFO_MAP_WARNING \
"[diskquota] the number of quota probe reached the limit, please " \
#define QUOTA_INFO_MAP_WARNING \
"the number of quota probe reached the limit, please " \
"increase the GUC value for diskquota.max_quota_probes."

/* global rejectmap for which exceed their quota limit */
Expand Down Expand Up @@ -188,8 +188,8 @@ static HTAB *table_size_map = NULL;
/* stored in shared memory */
static TimestampTz *table_size_map_last_overflow_report = NULL;

#define TABLE_SIZE_MAP_WARNING \
"[diskquota] the number of tables reached the limit, please increase " \
#define TABLE_SIZE_MAP_WARNING \
"the number of tables reached the limit, please increase " \
"the GUC value for diskquota.max_table_segments."

/* rejectmap for database objects which exceed their quota limit */
Expand All @@ -200,12 +200,12 @@ static TimestampTz disk_quota_reject_map_last_overflow_report = 0;
/* stored in shared memory */
static TimestampTz *local_disk_quota_reject_map_last_overflow_report = NULL;

#define DISK_QUOTA_REJECT_MAP_WARNING \
"[diskquota] the number of quota reject map entries reached the limit, " \
#define DISK_QUOTA_REJECT_MAP_WARNING \
"the number of quota reject map entries reached the limit, " \
"please increase the GUC value for diskquota.max_reject_entries."

#define LOCAL_DISK_QUOTA_REJECT_MAP_WARNING \
"[diskquota] the number of local quota reject map entries reached the limit, " \
#define LOCAL_DISK_QUOTA_REJECT_MAP_WARNING \
"the number of local quota reject map entries reached the limit, " \
"please increase the GUC value for diskquota.max_reject_entries."

static shmem_startup_hook_type prev_shmem_startup_hook = NULL;
Expand Down Expand Up @@ -507,6 +507,7 @@ diskquota_worker_shmem_size()
size = hash_estimate_size(MAX_NUM_TABLE_SIZE_ENTRIES / diskquota_max_monitored_databases + 100,
sizeof(TableSizeEntry));
size = add_size(size, hash_estimate_size(diskquota_max_local_reject_entries, sizeof(LocalRejectMapEntry)));
size = add_size(size, hash_estimate_size(MAX_QUOTA_MAP_ENTRIES, sizeof(QuotaInfoEntry)));
size = add_size(size, sizeof(TimestampTz)); // table_size_map_last_overflow_report
size = add_size(size, sizeof(TimestampTz)); // local_disk_quota_reject_map_last_overflow_report
size = add_size(size, sizeof(TimestampTz)); // quota_info_map_last_overflow_report
Expand Down Expand Up @@ -534,8 +535,6 @@ DiskQuotaShmemSize(void)
{
size = add_size(size, diskquota_launcher_shmem_size());
size = add_size(size, diskquota_worker_shmem_size() * diskquota_max_monitored_databases);
size = add_size(size, hash_estimate_size(MAX_QUOTA_MAP_ENTRIES, sizeof(QuotaInfoEntry)) *
diskquota_max_monitored_databases);
}

return size;
Expand Down
8 changes: 4 additions & 4 deletions src/relation_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ HTAB *relid_cache = NULL;

extern TimestampTz active_tables_map_last_overflow_report;

#define RELATION_CACHE_WARNING \
"[diskquota] the number of relation cache entries reached the limit, please increase " \
#define RELATION_CACHE_WARNING \
"the number of relation cache entries reached the limit, please increase " \
"the GUC value for diskquota.max_active_tables."

#define RELID_CACHE_WARNING \
"[diskquota] the number of relation cache entries reached the limit, please increase " \
#define RELID_CACHE_WARNING \
"the number of relid cache entries reached the limit, please increase " \
"the GUC value for diskquota.max_active_tables."

static void update_relation_entry(Oid relid, DiskQuotaRelationCacheEntry *relation_entry,
Expand Down

0 comments on commit a84787d

Please sign in to comment.