[jira] [Commented] (CASSANDRA-16071) max_compaction_flush_memory_in_mb is interpreted as bytes

2020-12-05 Thread Scott Carey (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-16071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17244553#comment-17244553
 ] 

Scott Carey commented on CASSANDRA-16071:
-

[~mck]

Thank you for the update script that simulates "alter index".  This is also 
useful if one wants to modify this value without rebuilding the index.

> max_compaction_flush_memory_in_mb is interpreted as bytes
> -
>
> Key: CASSANDRA-16071
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16071
> Project: Cassandra
>  Issue Type: Bug
>  Components: Feature/SASI
>Reporter: Michael Semb Wever
>Assignee: Michael Semb Wever
>Priority: Normal
> Fix For: 4.0, 3.11.8, 4.0-beta2, 4.0-beta4, 3.11.10
>
>
> In CASSANDRA-12662, [~scottcarey] 
> [reported|https://issues.apache.org/jira/browse/CASSANDRA-12662?focusedCommentId=17070055&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17070055]
>  that the {{max_compaction_flush_memory_in_mb}} setting gets incorrectly 
> interpreted in bytes rather than megabytes as its name implies.
> {quote}
> 1.  the setting 'max_compaction_flush_memory_in_mb' is a misnomer, it is 
> actually memory in BYTES.  If you take it at face value, and set it to say, 
> '512' thinking that means 512MB,  you will produce a million temp files 
> rather quickly in a large compaction, which will exhaust even large values of 
> max_map_count rapidly, and get the OOM: Map Error issue above and possibly 
> have a very difficult situation to get a cluster back into a place where 
> nodes aren't crashing while initilaizing or soon after.  This issue is minor 
> if you know about it in advance and set the value IN BYTES.
> {quote}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-16071) max_compaction_flush_memory_in_mb is interpreted as bytes

2020-11-21 Thread Michael Semb Wever (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-16071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17236687#comment-17236687
 ] 

Michael Semb Wever commented on CASSANDRA-16071:



Here is a manual migration you can use to avoid having to recreate the SASI, 
also while keeping it available during the upgrade.

- disable compactions on all nodes
- rolling upgrade all nodes (disabling again compactions upon restart)
- verify that the system.log files reported 
{noformat} ERROR [main] … IndexMode.java:196 - 
max_compaction_flush_memory_in_mb configured as … is above 100GB, reverting to 
default 1GB{noformat}
- verify the index still has the old setting
{code}cqlsh -e "select * from system_schema.indexes where keyspace_name = 
'' and table_name = '';"{code}

- edit the indexes table to the correct max_compaction_flush_memory_in_mb 
value. It is important to get all the values here correct, including all those 
in {{OPTIONS}}. Failure to do this correctly can leave the node unable to start.
{code}cqlsh
> update system_schema.indexes set options = {'class_name': 
> 'org.apache.cassandra.index.sasi.SASIIndex', 
> 'max_compaction_flush_memory_in_mb': '', 'target': 
> ''}  where keyspace_name = '' and table_name = 
> '' and index_name = '' ;{code}

- restart the node
- validate the ERROR message no longer appears during startup
- enable compactions on all nodes

> max_compaction_flush_memory_in_mb is interpreted as bytes
> -
>
> Key: CASSANDRA-16071
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16071
> Project: Cassandra
>  Issue Type: Bug
>  Components: Feature/SASI
>Reporter: Michael Semb Wever
>Assignee: Michael Semb Wever
>Priority: Normal
> Fix For: 4.0, 3.11.8, 4.0-beta2, 4.0-beta4, 3.11.10
>
>
> In CASSANDRA-12662, [~scottcarey] 
> [reported|https://issues.apache.org/jira/browse/CASSANDRA-12662?focusedCommentId=17070055&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17070055]
>  that the {{max_compaction_flush_memory_in_mb}} setting gets incorrectly 
> interpreted in bytes rather than megabytes as its name implies.
> {quote}
> 1.  the setting 'max_compaction_flush_memory_in_mb' is a misnomer, it is 
> actually memory in BYTES.  If you take it at face value, and set it to say, 
> '512' thinking that means 512MB,  you will produce a million temp files 
> rather quickly in a large compaction, which will exhaust even large values of 
> max_map_count rapidly, and get the OOM: Map Error issue above and possibly 
> have a very difficult situation to get a cluster back into a place where 
> nodes aren't crashing while initilaizing or soon after.  This issue is minor 
> if you know about it in advance and set the value IN BYTES.
> {quote}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-16071) max_compaction_flush_memory_in_mb is interpreted as bytes

2020-11-19 Thread Michael Semb Wever (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-16071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17235421#comment-17235421
 ] 

Michael Semb Wever commented on CASSANDRA-16071:


[~scott_carey], apologies for moving ahead with the upgrade protection patch 
before getting the feedback from you.

We definitely hear your concerns and pain around how to upgrade in this 
situation while maintaining the SASI available.

The approach of reverting to the default was chosen to minimise tech debt in 
the C* code, as having it continue to parse bytes is something likely to trap 
other C* developers and might just hurt other users down the road. The impact 
is also thought to be limited, i.e. not many will be in this situation of 
accurately incorrectly tuned max_compaction_flush_memory_in_mb in setups where 
the default value does not work at all and SASI availability is critical.

That being said, I will write up here soon a manual migration approach you can 
use to avoid having to recreate the SASI and keeping it available over the 
upgrade.

> max_compaction_flush_memory_in_mb is interpreted as bytes
> -
>
> Key: CASSANDRA-16071
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16071
> Project: Cassandra
>  Issue Type: Bug
>  Components: Feature/SASI
>Reporter: Michael Semb Wever
>Assignee: Michael Semb Wever
>Priority: Normal
> Fix For: 4.0, 3.11.8, 4.0-beta2, 4.0-beta4, 3.11.10
>
>
> In CASSANDRA-12662, [~scottcarey] 
> [reported|https://issues.apache.org/jira/browse/CASSANDRA-12662?focusedCommentId=17070055&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17070055]
>  that the {{max_compaction_flush_memory_in_mb}} setting gets incorrectly 
> interpreted in bytes rather than megabytes as its name implies.
> {quote}
> 1.  the setting 'max_compaction_flush_memory_in_mb' is a misnomer, it is 
> actually memory in BYTES.  If you take it at face value, and set it to say, 
> '512' thinking that means 512MB,  you will produce a million temp files 
> rather quickly in a large compaction, which will exhaust even large values of 
> max_map_count rapidly, and get the OOM: Map Error issue above and possibly 
> have a very difficult situation to get a cluster back into a place where 
> nodes aren't crashing while initilaizing or soon after.  This issue is minor 
> if you know about it in advance and set the value IN BYTES.
> {quote}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-16071) max_compaction_flush_memory_in_mb is interpreted as bytes

2020-11-18 Thread Scott Carey (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-16071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17235006#comment-17235006
 ] 

Scott Carey commented on CASSANDRA-16071:
-

On the other hand, maybe I'm the only one crazy enough to use this feature on 
an LCS table with 500GB of data per node.

> max_compaction_flush_memory_in_mb is interpreted as bytes
> -
>
> Key: CASSANDRA-16071
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16071
> Project: Cassandra
>  Issue Type: Bug
>  Components: Feature/SASI
>Reporter: Michael Semb Wever
>Assignee: Michael Semb Wever
>Priority: Normal
> Fix For: 4.0, 3.11.8, 4.0-beta2, 4.0-beta4, 3.11.10
>
>
> In CASSANDRA-12662, [~scottcarey] 
> [reported|https://issues.apache.org/jira/browse/CASSANDRA-12662?focusedCommentId=17070055&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17070055]
>  that the {{max_compaction_flush_memory_in_mb}} setting gets incorrectly 
> interpreted in bytes rather than megabytes as its name implies.
> {quote}
> 1.  the setting 'max_compaction_flush_memory_in_mb' is a misnomer, it is 
> actually memory in BYTES.  If you take it at face value, and set it to say, 
> '512' thinking that means 512MB,  you will produce a million temp files 
> rather quickly in a large compaction, which will exhaust even large values of 
> max_map_count rapidly, and get the OOM: Map Error issue above and possibly 
> have a very difficult situation to get a cluster back into a place where 
> nodes aren't crashing while initilaizing or soon after.  This issue is minor 
> if you know about it in advance and set the value IN BYTES.
> {quote}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-16071) max_compaction_flush_memory_in_mb is interpreted as bytes

2020-11-18 Thread Scott Carey (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-16071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17235004#comment-17235004
 ] 

Scott Carey commented on CASSANDRA-16071:
-

I still have to do a rolling re-index which is not very nice.   If it just 
interpreted the large values as if it were bytes it would be ok.  Sure, log a 
loud warning or something.   I don't comprehend why interpreting it as bytes 
for such values is problematic.   Maybe set a floor of some sort if 100k is too 
small.  But 1GB is useless for anyone who already set this lower than the 
default 1GB on purpose.

 

The default 1GB isn't safe either, due to the bugs I listed in the other 
ticket.   Large compactions with multiple output files are 1GB _per file_ 
_output_ per index in the worst case.   So a compaction that outputs 40 files 
from LCS id DOA on my environment at 1GB  – no different than setting it to 
1TB.   Anyone who set the value smaller than the default did so most likely to 
avoid going OOM.

I suppose the patch here will help some people, but is not helpful for me.  It 
does highlight the issue in the logs which is a big improvement.

To compound issues, the cassandra yum repo does not store older versions, so 
rolling back to 3.11.7 is non-trivial.

 

RE: the upgrade process

 

In no way is it acceptable in most environments using SASI to drop the old 
index and only then build the new one.   Most likely, there are queries that 
will not function without the index.   I have to build a new index with the new 
settings (but a different name), then drop the old one.  

I also have to carefully build them in the correct order since the query 
planner is dependent on the order of creation of the index.

 

If this interpreted the value as bytes when it is huge, I wouldn't have to 
create a new index.   If addressing the error log message was as simple as 
dividing the value by 2^20 and nothing else, it would probably even be 
reasonable to halt the start-up and correct it.  But as long as it is an index 
rebuild that can take a LONG time on a large table, I think this fix should be 
more sensitive to the operational cost incurred – after all this is a minor 
patch release and it seems unusual to require data rebuilds in such a patch.

> max_compaction_flush_memory_in_mb is interpreted as bytes
> -
>
> Key: CASSANDRA-16071
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16071
> Project: Cassandra
>  Issue Type: Bug
>  Components: Feature/SASI
>Reporter: Michael Semb Wever
>Assignee: Michael Semb Wever
>Priority: Normal
> Fix For: 4.0, 3.11.8, 4.0-beta2, 4.0-beta4, 3.11.10
>
>
> In CASSANDRA-12662, [~scottcarey] 
> [reported|https://issues.apache.org/jira/browse/CASSANDRA-12662?focusedCommentId=17070055&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17070055]
>  that the {{max_compaction_flush_memory_in_mb}} setting gets incorrectly 
> interpreted in bytes rather than megabytes as its name implies.
> {quote}
> 1.  the setting 'max_compaction_flush_memory_in_mb' is a misnomer, it is 
> actually memory in BYTES.  If you take it at face value, and set it to say, 
> '512' thinking that means 512MB,  you will produce a million temp files 
> rather quickly in a large compaction, which will exhaust even large values of 
> max_map_count rapidly, and get the OOM: Map Error issue above and possibly 
> have a very difficult situation to get a cluster back into a place where 
> nodes aren't crashing while initilaizing or soon after.  This issue is minor 
> if you know about it in advance and set the value IN BYTES.
> {quote}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-16071) max_compaction_flush_memory_in_mb is interpreted as bytes

2020-11-18 Thread Michael Semb Wever (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-16071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17234568#comment-17234568
 ] 

Michael Semb Wever commented on CASSANDRA-16071:


Committed upgrade protection as 
[ad9b7156bd3df143c1d090a3d77f9479d906e0ec|https://github.com/apache/cassandra/commit/ad9b7156bd3df143c1d090a3d77f9479d906e0ec].

> max_compaction_flush_memory_in_mb is interpreted as bytes
> -
>
> Key: CASSANDRA-16071
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16071
> Project: Cassandra
>  Issue Type: Bug
>  Components: Feature/SASI
>Reporter: Michael Semb Wever
>Assignee: Michael Semb Wever
>Priority: Normal
> Fix For: 4.0, 3.11.8, 4.0-beta2
>
>
> In CASSANDRA-12662, [~scottcarey] 
> [reported|https://issues.apache.org/jira/browse/CASSANDRA-12662?focusedCommentId=17070055&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17070055]
>  that the {{max_compaction_flush_memory_in_mb}} setting gets incorrectly 
> interpreted in bytes rather than megabytes as its name implies.
> {quote}
> 1.  the setting 'max_compaction_flush_memory_in_mb' is a misnomer, it is 
> actually memory in BYTES.  If you take it at face value, and set it to say, 
> '512' thinking that means 512MB,  you will produce a million temp files 
> rather quickly in a large compaction, which will exhaust even large values of 
> max_map_count rapidly, and get the OOM: Map Error issue above and possibly 
> have a very difficult situation to get a cluster back into a place where 
> nodes aren't crashing while initilaizing or soon after.  This issue is minor 
> if you know about it in advance and set the value IN BYTES.
> {quote}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-16071) max_compaction_flush_memory_in_mb is interpreted as bytes

2020-11-16 Thread Michael Semb Wever (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-16071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17232672#comment-17232672
 ] 

Michael Semb Wever commented on CASSANDRA-16071:


CI runs for 
[3.11|https://ci-cassandra.apache.org/job/Cassandra-devbranch/206/#showFailuresLink]
 and 
[trunk|https://ci-cassandra.apache.org/view/patches/job/Cassandra-devbranch/207/#showFailuresLink].

[~scottcarey], [~scott_carey], I am still waiting for your input before 
committing these patches.

> max_compaction_flush_memory_in_mb is interpreted as bytes
> -
>
> Key: CASSANDRA-16071
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16071
> Project: Cassandra
>  Issue Type: Bug
>  Components: Feature/SASI
>Reporter: Michael Semb Wever
>Assignee: Michael Semb Wever
>Priority: Normal
> Fix For: 4.0, 3.11.8, 4.0-beta2
>
>
> In CASSANDRA-12662, [~scottcarey] 
> [reported|https://issues.apache.org/jira/browse/CASSANDRA-12662?focusedCommentId=17070055&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17070055]
>  that the {{max_compaction_flush_memory_in_mb}} setting gets incorrectly 
> interpreted in bytes rather than megabytes as its name implies.
> {quote}
> 1.  the setting 'max_compaction_flush_memory_in_mb' is a misnomer, it is 
> actually memory in BYTES.  If you take it at face value, and set it to say, 
> '512' thinking that means 512MB,  you will produce a million temp files 
> rather quickly in a large compaction, which will exhaust even large values of 
> max_map_count rapidly, and get the OOM: Map Error issue above and possibly 
> have a very difficult situation to get a cluster back into a place where 
> nodes aren't crashing while initilaizing or soon after.  This issue is minor 
> if you know about it in advance and set the value IN BYTES.
> {quote}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-16071) max_compaction_flush_memory_in_mb is interpreted as bytes

2020-11-15 Thread Michael Semb Wever (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-16071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17232311#comment-17232311
 ] 

Michael Semb Wever commented on CASSANDRA-16071:



bq. right hand side will overflow..

fixed, and moved to a constant.

bq. nits: how about using FBUtilities#prettyPrintMemory for maxMemBytes

I first did that, but figured the raw value here is more intuitive, as it helps 
explain the mismatch between bytes and megabytes, and the calculation happening…

> max_compaction_flush_memory_in_mb is interpreted as bytes
> -
>
> Key: CASSANDRA-16071
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16071
> Project: Cassandra
>  Issue Type: Bug
>  Components: Feature/SASI
>Reporter: Michael Semb Wever
>Assignee: Michael Semb Wever
>Priority: Normal
> Fix For: 4.0, 3.11.8, 4.0-beta2
>
>
> In CASSANDRA-12662, [~scottcarey] 
> [reported|https://issues.apache.org/jira/browse/CASSANDRA-12662?focusedCommentId=17070055&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17070055]
>  that the {{max_compaction_flush_memory_in_mb}} setting gets incorrectly 
> interpreted in bytes rather than megabytes as its name implies.
> {quote}
> 1.  the setting 'max_compaction_flush_memory_in_mb' is a misnomer, it is 
> actually memory in BYTES.  If you take it at face value, and set it to say, 
> '512' thinking that means 512MB,  you will produce a million temp files 
> rather quickly in a large compaction, which will exhaust even large values of 
> max_map_count rapidly, and get the OOM: Map Error issue above and possibly 
> have a very difficult situation to get a cluster back into a place where 
> nodes aren't crashing while initilaizing or soon after.  This issue is minor 
> if you know about it in advance and set the value IN BYTES.
> {quote}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-16071) max_compaction_flush_memory_in_mb is interpreted as bytes

2020-11-15 Thread Zhao Yang (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-16071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17232306#comment-17232306
 ] 

Zhao Yang commented on CASSANDRA-16071:
---

bq. if the value is over 100GB, log an error and revert value back to default 
of 1GB. 

lgtm.

bq. if (maxMemBytes > 100 * 1073741824)

right hand side will overflow..

bq. logger.error("{} configured as {} is above 100GB, reverting to default 
1GB", INDEX_MAX_FLUSH_MEMORY_OPTION, maxMemBytes);



> max_compaction_flush_memory_in_mb is interpreted as bytes
> -
>
> Key: CASSANDRA-16071
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16071
> Project: Cassandra
>  Issue Type: Bug
>  Components: Feature/SASI
>Reporter: Michael Semb Wever
>Assignee: Michael Semb Wever
>Priority: Normal
> Fix For: 4.0, 3.11.8, 4.0-beta2
>
>
> In CASSANDRA-12662, [~scottcarey] 
> [reported|https://issues.apache.org/jira/browse/CASSANDRA-12662?focusedCommentId=17070055&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17070055]
>  that the {{max_compaction_flush_memory_in_mb}} setting gets incorrectly 
> interpreted in bytes rather than megabytes as its name implies.
> {quote}
> 1.  the setting 'max_compaction_flush_memory_in_mb' is a misnomer, it is 
> actually memory in BYTES.  If you take it at face value, and set it to say, 
> '512' thinking that means 512MB,  you will produce a million temp files 
> rather quickly in a large compaction, which will exhaust even large values of 
> max_map_count rapidly, and get the OOM: Map Error issue above and possibly 
> have a very difficult situation to get a cluster back into a place where 
> nodes aren't crashing while initilaizing or soon after.  This issue is minor 
> if you know about it in advance and set the value IN BYTES.
> {quote}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-16071) max_compaction_flush_memory_in_mb is interpreted as bytes

2020-11-15 Thread Michael Semb Wever (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-16071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17232257#comment-17232257
 ] 

Michael Semb Wever commented on CASSANDRA-16071:


I should have put this in NEWS.txt :-(

bq.  A safe bet would be to interpret anything over 10 (100GB in MB, but 
only 100K if bytes) as bytes…

This is smart. Though I'm uneasy with continuing to interpret the value in 
bytes. 
Here are patches for 
[3.11|https://github.com/apache/cassandra/compare/cassandra-3.11...thelastpickle:mck/cassandra-3.11_16701_2]
 and 
[trunk|https://github.com/apache/cassandra/compare/trunk...thelastpickle:mck/trunk_16071_2]
 that, if the value is over 100GB, log an error and revert value back to 
default of 1GB. This won't be ideal in all situations, but I believe it means 
users will correct the configuration and will be therefore safer in the longer 
run. wdyt [~scott_carey], [~jasonstack]?


Rehashing the pain…

Clusters that had previously configured {{max_compaction_flush_memory_in_mb}} 
as bytes,  must take one of the upgrade actions,

Upgrading to 3.11.8 or 3.11.9:
- disable compactions on all nodes 
- rolling upgrade all nodes (disabling compactions upon restart)
- drop and recreate index with correct {{max_compaction_flush_memory_in_mb}} mb 
value
- enable compactions on all nodes

With the patches proposed, upgrading to 3.11.10+:
- rolling upgrade all nodes
- drop and recreate index with correct {{max_compaction_flush_memory_in_mb}} mb 
value




> max_compaction_flush_memory_in_mb is interpreted as bytes
> -
>
> Key: CASSANDRA-16071
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16071
> Project: Cassandra
>  Issue Type: Bug
>  Components: Feature/SASI
>Reporter: Michael Semb Wever
>Assignee: Michael Semb Wever
>Priority: Normal
> Fix For: 4.0, 3.11.8, 4.0-beta2
>
>
> In CASSANDRA-12662, [~scottcarey] 
> [reported|https://issues.apache.org/jira/browse/CASSANDRA-12662?focusedCommentId=17070055&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17070055]
>  that the {{max_compaction_flush_memory_in_mb}} setting gets incorrectly 
> interpreted in bytes rather than megabytes as its name implies.
> {quote}
> 1.  the setting 'max_compaction_flush_memory_in_mb' is a misnomer, it is 
> actually memory in BYTES.  If you take it at face value, and set it to say, 
> '512' thinking that means 512MB,  you will produce a million temp files 
> rather quickly in a large compaction, which will exhaust even large values of 
> max_map_count rapidly, and get the OOM: Map Error issue above and possibly 
> have a very difficult situation to get a cluster back into a place where 
> nodes aren't crashing while initilaizing or soon after.  This issue is minor 
> if you know about it in advance and set the value IN BYTES.
> {quote}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-16071) max_compaction_flush_memory_in_mb is interpreted as bytes

2020-11-14 Thread Scott Carey (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-16071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17232194#comment-17232194
 ] 

Scott Carey commented on CASSANDRA-16071:
-

Its worse than I remembered.   Updating to the latest cassandra with this fix 
in will take down nodes.  The configuration option is on the index itself, and 
there is no 'alter index' option to reset the max_compaction_flush_memory_in_mb 
value.    The whole cluster must be updated to the new version, then compaction 
has to be either stopped or delicately monitored, then _new_ indexes need to be 
built with the updated values for max_compaction_flush_memory_in_mb, and then 
the old indexes can be removed.   

 

The new values will destroy old versions with death-by-a-million-open-files, 
and the old values will destroy new nodes with OOM during compaction.

 

I wish I had seen this fix before it was committed.  It should have detected 
'unusually large' values and interpreted them as bytes.

 

For example, '2048' is 20MB if interpreted as bytes.  If interpreted as MB 
its way over any reasonable size – 20TB.   A safe bet would be to interpret 
anything over 10 (100GB in MB, but only 100K if bytes) as bytes, and 
anything below that as GB.  Then this wouldn't be a migration nightmare.

> max_compaction_flush_memory_in_mb is interpreted as bytes
> -
>
> Key: CASSANDRA-16071
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16071
> Project: Cassandra
>  Issue Type: Bug
>  Components: Feature/SASI
>Reporter: Michael Semb Wever
>Assignee: Michael Semb Wever
>Priority: Normal
> Fix For: 4.0, 3.11.8, 4.0-beta2
>
>
> In CASSANDRA-12662, [~scottcarey] 
> [reported|https://issues.apache.org/jira/browse/CASSANDRA-12662?focusedCommentId=17070055&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17070055]
>  that the {{max_compaction_flush_memory_in_mb}} setting gets incorrectly 
> interpreted in bytes rather than megabytes as its name implies.
> {quote}
> 1.  the setting 'max_compaction_flush_memory_in_mb' is a misnomer, it is 
> actually memory in BYTES.  If you take it at face value, and set it to say, 
> '512' thinking that means 512MB,  you will produce a million temp files 
> rather quickly in a large compaction, which will exhaust even large values of 
> max_map_count rapidly, and get the OOM: Map Error issue above and possibly 
> have a very difficult situation to get a cluster back into a place where 
> nodes aren't crashing while initilaizing or soon after.  This issue is minor 
> if you know about it in advance and set the value IN BYTES.
> {quote}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-16071) max_compaction_flush_memory_in_mb is interpreted as bytes

2020-09-17 Thread Scott Carey (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-16071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17197916#comment-17197916
 ] 

Scott Carey commented on CASSANDRA-16071:
-

Heads-up for anyone currently working around this bug by setting the value in 
bytes.

With this bug fix, it appears we will need to change our config file or risk 
going OOM.  For me, it will go from a setting of 10MB to 10TB when the version 
is bumped if I don't change the config when updating.

> max_compaction_flush_memory_in_mb is interpreted as bytes
> -
>
> Key: CASSANDRA-16071
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16071
> Project: Cassandra
>  Issue Type: Bug
>  Components: Feature/SASI
>Reporter: Michael Semb Wever
>Assignee: Michael Semb Wever
>Priority: Normal
> Fix For: 4.0, 3.11.8, 4.0-beta2
>
>
> In CASSANDRA-12662, [~scottcarey] 
> [reported|https://issues.apache.org/jira/browse/CASSANDRA-12662?focusedCommentId=17070055&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17070055]
>  that the {{max_compaction_flush_memory_in_mb}} setting gets incorrectly 
> interpreted in bytes rather than megabytes as its name implies.
> {quote}
> 1.  the setting 'max_compaction_flush_memory_in_mb' is a misnomer, it is 
> actually memory in BYTES.  If you take it at face value, and set it to say, 
> '512' thinking that means 512MB,  you will produce a million temp files 
> rather quickly in a large compaction, which will exhaust even large values of 
> max_map_count rapidly, and get the OOM: Map Error issue above and possibly 
> have a very difficult situation to get a cluster back into a place where 
> nodes aren't crashing while initilaizing or soon after.  This issue is minor 
> if you know about it in advance and set the value IN BYTES.
> {quote}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-16071) max_compaction_flush_memory_in_mb is interpreted as bytes

2020-08-25 Thread ZhaoYang (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-16071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17184111#comment-17184111
 ] 

ZhaoYang commented on CASSANDRA-16071:
--

Thanks for the patch. LGTM.

> max_compaction_flush_memory_in_mb is interpreted as bytes
> -
>
> Key: CASSANDRA-16071
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16071
> Project: Cassandra
>  Issue Type: Bug
>  Components: Feature/SASI
>Reporter: Michael Semb Wever
>Assignee: Michael Semb Wever
>Priority: Normal
> Fix For: 3.11.x, 4.0-beta
>
>
> In CASSANDRA-12662, [~scottcarey] 
> [reported|https://issues.apache.org/jira/browse/CASSANDRA-12662?focusedCommentId=17070055&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17070055]
>  that the {{max_compaction_flush_memory_in_mb}} setting gets incorrectly 
> interpreted in bytes rather than megabytes as its name implies.
> {quote}
> 1.  the setting 'max_compaction_flush_memory_in_mb' is a misnomer, it is 
> actually memory in BYTES.  If you take it at face value, and set it to say, 
> '512' thinking that means 512MB,  you will produce a million temp files 
> rather quickly in a large compaction, which will exhaust even large values of 
> max_map_count rapidly, and get the OOM: Map Error issue above and possibly 
> have a very difficult situation to get a cluster back into a place where 
> nodes aren't crashing while initilaizing or soon after.  This issue is minor 
> if you know about it in advance and set the value IN BYTES.
> {quote}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-16071) max_compaction_flush_memory_in_mb is interpreted as bytes

2020-08-25 Thread Michael Semb Wever (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-16071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17184038#comment-17184038
 ] 

Michael Semb Wever commented on CASSANDRA-16071:


Unit test added.

> max_compaction_flush_memory_in_mb is interpreted as bytes
> -
>
> Key: CASSANDRA-16071
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16071
> Project: Cassandra
>  Issue Type: Bug
>  Components: Feature/SASI
>Reporter: Michael Semb Wever
>Assignee: Michael Semb Wever
>Priority: Normal
> Fix For: 3.11.x, 4.0-beta
>
>
> In CASSANDRA-12662, [~scottcarey] 
> [reported|https://issues.apache.org/jira/browse/CASSANDRA-12662?focusedCommentId=17070055&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17070055]
>  that the {{max_compaction_flush_memory_in_mb}} setting gets incorrectly 
> interpreted in bytes rather than megabytes as its name implies.
> {quote}
> 1.  the setting 'max_compaction_flush_memory_in_mb' is a misnomer, it is 
> actually memory in BYTES.  If you take it at face value, and set it to say, 
> '512' thinking that means 512MB,  you will produce a million temp files 
> rather quickly in a large compaction, which will exhaust even large values of 
> max_map_count rapidly, and get the OOM: Map Error issue above and possibly 
> have a very difficult situation to get a cluster back into a place where 
> nodes aren't crashing while initilaizing or soon after.  This issue is minor 
> if you know about it in advance and set the value IN BYTES.
> {quote}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-16071) max_compaction_flush_memory_in_mb is interpreted as bytes

2020-08-24 Thread Michael Semb Wever (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-16071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17183253#comment-17183253
 ] 

Michael Semb Wever commented on CASSANDRA-16071:


bq. How about we rename "maxMemMb" to "maxMemBytes" and rename
"IndexMode#maxCompactionFlushMemoryInMb" to "maxCompactionFlushMemoryInBytes".

Done. And CI runs added.

> max_compaction_flush_memory_in_mb is interpreted as bytes
> -
>
> Key: CASSANDRA-16071
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16071
> Project: Cassandra
>  Issue Type: Bug
>  Components: Feature/SASI
>Reporter: Michael Semb Wever
>Assignee: Michael Semb Wever
>Priority: Normal
> Fix For: 3.11.x, 4.0-beta
>
>
> In CASSANDRA-12662, [~scottcarey] 
> [reported|https://issues.apache.org/jira/browse/CASSANDRA-12662?focusedCommentId=17070055&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17070055]
>  that the {{max_compaction_flush_memory_in_mb}} setting gets incorrectly 
> interpreted in bytes rather than megabytes as its name implies.
> {quote}
> 1.  the setting 'max_compaction_flush_memory_in_mb' is a misnomer, it is 
> actually memory in BYTES.  If you take it at face value, and set it to say, 
> '512' thinking that means 512MB,  you will produce a million temp files 
> rather quickly in a large compaction, which will exhaust even large values of 
> max_map_count rapidly, and get the OOM: Map Error issue above and possibly 
> have a very difficult situation to get a cluster back into a place where 
> nodes aren't crashing while initilaizing or soon after.  This issue is minor 
> if you know about it in advance and set the value IN BYTES.
> {quote}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-16071) max_compaction_flush_memory_in_mb is interpreted as bytes

2020-08-24 Thread ZhaoYang (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-16071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17183177#comment-17183177
 ] 

ZhaoYang commented on CASSANDRA-16071:
--

{code:java}
 long maxMemMb = indexOptions.get(INDEX_MAX_FLUSH_MEMORY_OPTION) == null
  ? (long) (1048576 * INDEX_MAX_FLUSH_DEFAULT_MULTIPLIER) // 1G default for 
memtable
  : Long.parseLong(indexOptions.get(INDEX_MAX_FLUSH_MEMORY_OPTION));
{code}
[~mck] I think the default {{"1048576 * 0.15 mb"}} may still cause OOM.

 

How about we rename {{"maxMemMb"}} to {{"maxMemBytes"}}. So it should be :
{code:java}
 long maxMemBytes = indexOptions.get(INDEX_MAX_FLUSH_MEMORY_OPTION) == null
  ? (long) (1073741824 * INDEX_MAX_FLUSH_DEFAULT_MULTIPLIER) // 1G default for 
memtable
  : 1048576L * Long.parseLong(indexOptions.get(INDEX_MAX_FLUSH_MEMORY_OPTION));
{code}

> max_compaction_flush_memory_in_mb is interpreted as bytes
> -
>
> Key: CASSANDRA-16071
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16071
> Project: Cassandra
>  Issue Type: Bug
>  Components: Feature/SASI
>Reporter: Michael Semb Wever
>Assignee: Michael Semb Wever
>Priority: Normal
> Fix For: 3.11.x, 4.0-beta
>
>
> In CASSANDRA-12662, [~scottcarey] 
> [reported|https://issues.apache.org/jira/browse/CASSANDRA-12662?focusedCommentId=17070055&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17070055]
>  that the {{max_compaction_flush_memory_in_mb}} setting gets incorrectly 
> interpreted in bytes rather than megabytes as its name implies.
> {quote}
> 1.  the setting 'max_compaction_flush_memory_in_mb' is a misnomer, it is 
> actually memory in BYTES.  If you take it at face value, and set it to say, 
> '512' thinking that means 512MB,  you will produce a million temp files 
> rather quickly in a large compaction, which will exhaust even large values of 
> max_map_count rapidly, and get the OOM: Map Error issue above and possibly 
> have a very difficult situation to get a cluster back into a place where 
> nodes aren't crashing while initilaizing or soon after.  This issue is minor 
> if you know about it in advance and set the value IN BYTES.
> {quote}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-16071) max_compaction_flush_memory_in_mb is interpreted as bytes

2020-08-24 Thread Michael Semb Wever (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-16071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17183111#comment-17183111
 ] 

Michael Semb Wever commented on CASSANDRA-16071:


Patches
 - 
[3.11|https://github.com/apache/cassandra/compare/trunk...thelastpickle:mck/cassandra-3.11_max_compaction_flush_memory_in_mb_fix]
 
 - 
[trunk|https://github.com/apache/cassandra/compare/trunk...thelastpickle:mck/trunk_max_compaction_flush_memory_in_mb_fix]
 

(will update with CI later today…)

> max_compaction_flush_memory_in_mb is interpreted as bytes
> -
>
> Key: CASSANDRA-16071
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16071
> Project: Cassandra
>  Issue Type: Bug
>  Components: Feature/SASI
>Reporter: Michael Semb Wever
>Assignee: Michael Semb Wever
>Priority: Normal
> Fix For: 3.11.x, 4.0-beta
>
>
> In CASSANDRA-12662, [~scottcarey] 
> [reported|https://issues.apache.org/jira/browse/CASSANDRA-12662?focusedCommentId=17070055&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17070055]
>  that the {{max_compaction_flush_memory_in_mb}} setting gets incorrectly 
> interpreted in bytes rather than megabytes as its name implies.
> {quote}
> 1.  the setting 'max_compaction_flush_memory_in_mb' is a misnomer, it is 
> actually memory in BYTES.  If you take it at face value, and set it to say, 
> '512' thinking that means 512MB,  you will produce a million temp files 
> rather quickly in a large compaction, which will exhaust even large values of 
> max_map_count rapidly, and get the OOM: Map Error issue above and possibly 
> have a very difficult situation to get a cluster back into a place where 
> nodes aren't crashing while initilaizing or soon after.  This issue is minor 
> if you know about it in advance and set the value IN BYTES.
> {quote}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org