Michael Semb Wever created CASSANDRA-21698:
----------------------------------------------
Summary: Rate limit the warning for an obsolete CQL property
Key: CASSANDRA-21698
URL: https://issues.apache.org/jira/browse/CASSANDRA-21698
Project: Apache Cassandra
Issue Type: Improvement
Components: CQL/Semantics
Reporter: Michael Semb Wever
{{PropertyDefinitions.validate}} warns once per statement for each obsolete
property a {{CREATE}} or {{ALTER}} statement names:
{code:java}
if (obsolete.contains(name))
logger.warn("Ignoring obsolete property {}", name);
{code}
A client can repeat such a statement without limit, and an application that
repeats one on a schedule fills the log with a line that carries no new
information. The names that reach the branch are the properties a statement
still accepts and ignores, so the operator learns nothing from the second line
that the first did not say.
The patch logs the warning through {{NoSpamLogger}}, keyed on the property
name, so each obsolete property warns at most once every 30 seconds. The key
space is bounded, because each statement holds a fixed set of obsolete property
names, so no client input reaches the key.
Patch:
[mck/upstream/obsolete-property-log-spam/5.0|https://github.com/thelastpickle/cassandra/tree/mck/upstream/obsolete-property-log-spam/5.0]
Provenance:
[689860ef70|https://github.com/datastax/cassandra/commit/689860ef7093f75b7ea1e79d54c3ee0f9dbb7f16]
by Marcel SpryszyĆski. That commit rate limits the same warning with a
hand-rolled map of name to timestamp, which never updates the timestamp once an
interval has passed, so it then warns on every statement, and it reads the
result through reflection in its test. This patch uses the existing
{{NoSpamLogger}} keyed API instead, and tests the logging through an appender.
The author works for IBM and the IBM licence grant approval is pending. The
file carries no {{Copyright IBM Corp.}} header, and this patch adds none.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]