cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sylvain Lebresne (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-9193) Facility to write dynamic code to selectively trigger trace or log for queries
Date Tue, 21 Apr 2015 08:34:00 GMT


Sylvain Lebresne commented on CASSANDRA-9193:

I don't know, I'm sorry to be difficult but I don't really like the idea of having people
write functions that manipulate internal data structures (like ReadCommand). Those stuffs
are way too volatile to make a user-facing API depend on it (please don't get me wrong, I'm
not saying we haven't done such things in the past, I'm saying that every single time we've
done it, we've come to regret it and it has been a bad user experience).

I also really agree that this should reuse stuffs from CASSANDRA-7526 as much as possible
rather than being JS specific.

Anyway, I'm going to go out on a limb here since I haven't though too much about this, but
the kind of interface I would prefer would be something along the lines of:
    if (!r.isSelect())

    if (r.consistency().equals("ALL"))

    if (r.size() > 500000)

    // If the request has 'c1 = 3' in the WHERE clause
    if (r.selects("c1", 3))

INJECT myFunction ON REQUEST TO myKs.myCf;
I'm not attached to any of the specifics here, it's just to say that it would be ideal in
my book if 1) we could reuse UDFs and 2) having it directly doable from CQL.  I'm also her
implying we'd add some custom {{request}} object that we'd pass to the function and would
also to get the different parameters of a request.

> Facility to write dynamic code to selectively trigger trace or log for queries
> ------------------------------------------------------------------------------
>                 Key: CASSANDRA-9193
>                 URL:
>             Project: Cassandra
>          Issue Type: New Feature
>            Reporter: Matt Stump
> I want the equivalent of dtrace for Cassandra. I want the ability to intercept a query
with a dynamic script (assume JS) and based on logic in that script trigger the statement
for trace or logging. 
> Examples 
> - Trace only INSERT statements to a particular CF. 
> - Trace statements for a particular partition or consistency level.
> - Log statements that fail to reach the desired consistency for read or write.
> - Log If the request size for read or write exceeds some threshold
> At some point in the future it would be helpful to also do things such as log partitions
greater than X bytes or Z cells when performing compaction. Essentially be able to inject
custom code dynamically without a reboot to the different stages of C*. 
> The code should be executed synchronously as part of the monitored task, but we should
provide the ability to log or execute CQL asynchronously from the provided API.
> Further down the line we could use this functionality to modify/rewrite requests or tasks

This message was sent by Atlassian JIRA

View raw message