Description
It's possible to create a continuous query that causes a data loop and thus creation of infinite number of time series until the server crashes. It should guard against this.
For example, say you're writing things like stats.cpu
and stats.memory
. And then you issue a continuous query like this:
select from /stats\..*/ group by time(5m) into :series_name.5m
That will cause an infinite series loop. The first time it runs it'll output stats.cpu.5m
and stats.memory.5m
and then the next time it runs it'll output those and stats.cpu.5m.5m
and stats.memory.5m.5m
and on and on.
This should be guarded against in two places. First, before the continuous query gets created, it should issue a query, and check the resulting series names against the regex matcher. If it matches, it should not create the query and return an infinite data loop error.
The other possibility is that it passes the first test, but then they start writing data in that would cause this. So whenever a continuous query is run, it should check the resulting time series against the regex matcher to ensure it doesn't match. If it does, don't write the point and log an error in the log so the user knows.
Activity
nichdiekuh commentedon Mar 11, 2014
👍
pauldix commentedon Mar 31, 2014
These would be a valid queries that don't have data loops:
You need to enforce a few things only if they have
:series_name
on the into clause.^
at the beginning OR they have a$
at the end:series_name
OR it doesn't end with:series_name
I think that would be sufficient.
8 remaining items