aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorAnton Yuzhaninov <citrin+git@citrin.ru>2020-07-29 16:49:06 +0100
committerAnton Yuzhaninov <citrin+git@citrin.ru>2020-08-04 17:58:13 +0100
commita7f6a6ed078911b9ee76e63eed5da631aa78a845 (patch)
treecd7df24ab8a41d760307e08e71f926cb50a245a1 /src/plugins
parent628ec9d29b47836ff1fad3a4f9054c12fe01621a (diff)
downloadrspamd-a7f6a6ed078911b9ee76e63eed5da631aa78a845.tar.gz
rspamd-a7f6a6ed078911b9ee76e63eed5da631aa78a845.zip
[Minor] Use descriptive variable name
PARTITION and PARTITION ID in ClickHouse are different: https://clickhouse.tech/docs/en/sql-reference/statements/alter/partition/#alter-how-to-specify-part-expr and we use PARTITION clause here.
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/lua/clickhouse.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/lua/clickhouse.lua b/src/plugins/lua/clickhouse.lua
index 3a4b1f802..578a35365 100644
--- a/src/plugins/lua/clickhouse.lua
+++ b/src/plugins/lua/clickhouse.lua
@@ -864,15 +864,15 @@ local function clickhouse_collect(task)
used_memory, settings.limits.max_memory)
end
-local function do_remove_partition(ev_base, cfg, table_name, partition_id)
- lua_util.debugm(N, rspamd_config, "removing partition %s.%s", table_name, partition_id)
+local function do_remove_partition(ev_base, cfg, table_name, partition)
+ lua_util.debugm(N, rspamd_config, "removing partition %s.%s", table_name, partition)
local upstream = settings.upstream:get_upstream_round_robin()
- local remove_partition_sql = "ALTER TABLE ${table_name} ${remove_method} PARTITION '${partition_id}'"
+ local remove_partition_sql = "ALTER TABLE ${table_name} ${remove_method} PARTITION '${partition}'"
local remove_method = (settings.retention.method == 'drop') and 'DROP' or 'DETACH'
local sql_params = {
['table_name'] = table_name,
['remove_method'] = remove_method,
- ['partition_id'] = partition_id
+ ['partition'] = partition
}
local sql = lua_util.template(remove_partition_sql, sql_params)
@@ -887,13 +887,13 @@ local function do_remove_partition(ev_base, cfg, table_name, partition_id)
if err then
rspamd_logger.errx(rspamd_config,
"cannot detach partition %s:%s from server %s: %s",
- table_name, partition_id,
+ table_name, partition,
settings['server'], err)
return
end
rspamd_logger.infox(rspamd_config,
- 'detached partition %s:%s on server %s', table_name, partition_id,
+ 'detached partition %s:%s on server %s', table_name, partition,
settings['server'])
end