cass_cluster_set_write_bytes_high_water_mark() doesn't seem to work under cpp-driver 2.0

382 views
Skip to first unread message

Karl Lehenbauer

unread,
May 11, 2015, 11:57:57 AM5/11/15
to cpp-dri...@lists.datastax.com
We've upgraded our Tcl interface to Cassandra, casstcl (https://github.com/flightaware/casstcl), to work with version 2.0 of the cpp-driver.

I'm now getting warn-level logging callbacks about the write bytes water mark being exceeded with a program that didn't do that with the prior version.

I put in a printf to make sure it is getting set and it logs "invoked cass_cluster_set_write_bytes_high_water_mark with value 16777216"

The warnings I get back are like:

1431359480.640 [WARN] (:232:bool cass::Connection::write(cass::Handler *, bool)): Exceeded write bytes water mark (current: 367403 water mark: 65536) on connection to host 10.3.3.6

Here's how I'm setting up the cassandra connection:

$::cass queue_size_io 16384
$::cass max_concurrent_creation 10
$::cass num_threads_io 8
$::cass core_connections_per_host 4
$::cass max_connections_per_host 16
$::cass write_bytes_high_water_mark [expr {16 * 1024 * 1024}]
$::cass write_bytes_low_water_mark 32768

Michael Penick

unread,
May 11, 2015, 7:33:02 PM5/11/15
to cpp-dri...@lists.datastax.com
It looks like the application is attempting to set the high watermark lower than the low watermark. The library returns  CASS_ERROR_LIB_BAD_PARAMS in that case. The low watermark needs to be set higher first.

Mike

To unsubscribe from this group and stop receiving emails from it, send an email to cpp-driver-us...@lists.datastax.com.

Karl Lehenbauer

unread,
May 11, 2015, 7:47:26 PM5/11/15
to cpp-dri...@lists.datastax.com
On Monday, May 11, 2015 at 6:33:02 PM UTC-5, Michael Penick wrote:
> It looks like the application is attempting to set the high watermark lower than the low watermark. The library returns 
> CASS_ERROR_LIB_BAD_PARAMS in that case. The low watermark needs to be set higher first.

Thanks for the reply, Michael. I looked at the cpp-driver code too and saw that it is indeed an error to set the high water number to be lower than the low water number but 1) I did not do this and 2) I did not get an error setting either the high or low water mark.

To test I changed to set the low water mark first to a megabyte and the high water second to 16 gigs. No error.

But then when the program gets going, after apparently successfully setting the high water mark to 16 megs, the logging warnings say the high water mark of 65,536 bytes is being exceeded:

1431387553.739 [WARN] (:232:bool cass::Connection::write(cass::Handler *, bool)): Exceeded write bytes water mark (current: 901319 water mark: 65536) on connection to host 10.3.3.8

To recap: I set the high water mark to 16 megs without error. I start writing, I get warnings back from the logging callback that the write bytes water mark of the default value of 65536 is being exceeded. The problem happens with the 2.0 version of cpp-driver but not with 1.0.

For another test I tried setting the high water mark to 16,384, below the low water mark, and that didn't work either -- it doesn't error and then I get warnings saying the 64K high water mark is being exceeded. I'll dig a little deeper from home tonight but right now I am still asserting that setting the high water mark somehow broke in 2.0.

Michael Penick

unread,
May 13, 2015, 2:19:03 PM5/13/15
to cpp-dri...@lists.datastax.com
I verified that  "cass_cluster_set_write_bytes_high_water_mark()" does work on the current 2.0 branch. I did this by using the perf example and setting defining "DO_SELECT 0" which causes insert writes to exceed the pending write bytes high watermark. I then bumped it up (over several iterations) verifying that it did indeed update the setting and the log message:

1431540782.474 [WARN] (src/connection.cpp:232:bool cass::Connection::write(cass::Handler *, bool)): Exceeded write bytes water mark (current: 209475 water mark: 200000) on connection to host 127.0.0.1

for "cass_cluster_set_write_bytes_high_water_mark(cluster, 200000);".

Maybe there's some other issue?

Mike

Karl Lehenbauer

unread,
May 13, 2015, 3:42:52 PM5/13/15
to cpp-dri...@lists.datastax.com
On Wednesday, May 13, 2015 at 1:19:03 PM UTC-5, Michael Penick wrote:
> I verified that  "cass_cluster_set_write_bytes_high_water_mark()" does work on the current 2.0 branch.

OK, Mike, I'll keep looking. Thanks. -karl
Message has been deleted

Karl Lehenbauer

unread,
May 26, 2015, 1:25:48 PM5/26/15
to cpp-dri...@lists.datastax.com
Figured it out. Settings such as cass_cluster_set_write_bytes_high_water_mark() must be done before connecting.
Reply all
Reply to author
Forward
0 new messages