[jira] [Commented] (CASSANDRA-14477) The check of num_tokens against the length of inital_token in the yaml triggers unexpectedly

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


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

Michael Semb Wever commented on CASSANDRA-14477:


bq. the Cassandra-devbranch jenkins pipeline should be including dtest-novnode

Committed as 
[69cfcb31078dd9d79d19d29d5c4543832fa00ffa|https://github.com/apache/cassandra-builds/commit/69cfcb31078dd9d79d19d29d5c4543832fa00ffa].

> The check of num_tokens against the length of inital_token in the yaml 
> triggers unexpectedly
> 
>
> Key: CASSANDRA-14477
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14477
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Vincent White
>Assignee: Stefan Miklosovic
>Priority: Low
> Fix For: 3.0.23, 3.11.9, 4.0-beta4
>
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> In CASSANDRA-10120 we added a check that compares num_tokens against the 
> number of tokens supplied in the yaml via initial_token. From my reading of 
> CASSANDRA-10120 it was to prevent cassandra starting if the yaml contained 
> contradictory values for num_tokens and initial_tokens which should help 
> prevent misconfiguration via human error. The current behaviour appears to 
> differ slightly in that it performs this comparison regardless of whether 
> num_tokens is included in the yaml or not. Below are proposed patches to only 
> perform the check if both options are present in the yaml.
> ||Branch||
> |[3.0.x|https://github.com/apache/cassandra/compare/cassandra-3.0...vincewhite:num_tokens_30]|
> |[3.x|https://github.com/apache/cassandra/compare/cassandra-3.11...vincewhite:num_tokens_test_1_311]|



--
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-14477) The check of num_tokens against the length of inital_token in the yaml triggers unexpectedly

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


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

Michael Semb Wever commented on CASSANDRA-14477:


bq. the check for num_tokens being defined should be skipped if initial_tokens 
defines only one token, as it unlikely to be a typo, folk would rarely be 
configuring two tokens, and just one initial_token is the traditional 
non-vnodes configuration predating the use of num_tokens
 
Committed as 
[bfd5d20a13501d897d8d34acce9b0394fa1cf00b|https://github.com/apache/cassandra/commit/bfd5d20a13501d897d8d34acce9b0394fa1cf00b].

> The check of num_tokens against the length of inital_token in the yaml 
> triggers unexpectedly
> 
>
> Key: CASSANDRA-14477
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14477
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Vincent White
>Assignee: Stefan Miklosovic
>Priority: Low
> Fix For: 3.0.23, 3.11.9, 4.0-beta4
>
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> In CASSANDRA-10120 we added a check that compares num_tokens against the 
> number of tokens supplied in the yaml via initial_token. From my reading of 
> CASSANDRA-10120 it was to prevent cassandra starting if the yaml contained 
> contradictory values for num_tokens and initial_tokens which should help 
> prevent misconfiguration via human error. The current behaviour appears to 
> differ slightly in that it performs this comparison regardless of whether 
> num_tokens is included in the yaml or not. Below are proposed patches to only 
> perform the check if both options are present in the yaml.
> ||Branch||
> |[3.0.x|https://github.com/apache/cassandra/compare/cassandra-3.0...vincewhite:num_tokens_30]|
> |[3.x|https://github.com/apache/cassandra/compare/cassandra-3.11...vincewhite:num_tokens_test_1_311]|



--
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-14477) The check of num_tokens against the length of inital_token in the yaml triggers unexpectedly

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


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

Michael Semb Wever commented on CASSANDRA-14477:


bq. he check for num_tokens being defined should be skipped if initial_tokens 
defines only one token, as it unlikely to be a typo, folk would rarely be 
configuring two tokens, and just one initial_token is the traditional 
non-vnodes configuration predating the use of num_tokens

[~stefan.miklosovic] has added fixes for each branch on the same PRs above.

> The check of num_tokens against the length of inital_token in the yaml 
> triggers unexpectedly
> 
>
> Key: CASSANDRA-14477
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14477
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Vincent White
>Assignee: Stefan Miklosovic
>Priority: Low
> Fix For: 3.0.23, 3.11.9, 4.0-beta4
>
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> In CASSANDRA-10120 we added a check that compares num_tokens against the 
> number of tokens supplied in the yaml via initial_token. From my reading of 
> CASSANDRA-10120 it was to prevent cassandra starting if the yaml contained 
> contradictory values for num_tokens and initial_tokens which should help 
> prevent misconfiguration via human error. The current behaviour appears to 
> differ slightly in that it performs this comparison regardless of whether 
> num_tokens is included in the yaml or not. Below are proposed patches to only 
> perform the check if both options are present in the yaml.
> ||Branch||
> |[3.0.x|https://github.com/apache/cassandra/compare/cassandra-3.0...vincewhite:num_tokens_30]|
> |[3.x|https://github.com/apache/cassandra/compare/cassandra-3.11...vincewhite:num_tokens_test_1_311]|



--
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-14477) The check of num_tokens against the length of inital_token in the yaml triggers unexpectedly

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


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

Michael Semb Wever commented on CASSANDRA-14477:


bq. the Cassandra-devbranch jenkins pipeline should be including dtest-novnode

patch for that 
[here|https://github.com/apache/cassandra-builds/compare/trunk...thelastpickle:mck/14477]

> The check of num_tokens against the length of inital_token in the yaml 
> triggers unexpectedly
> 
>
> Key: CASSANDRA-14477
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14477
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Vincent White
>Assignee: Stefan Miklosovic
>Priority: Low
> Fix For: 3.0.23, 3.11.9, 4.0-beta4
>
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> In CASSANDRA-10120 we added a check that compares num_tokens against the 
> number of tokens supplied in the yaml via initial_token. From my reading of 
> CASSANDRA-10120 it was to prevent cassandra starting if the yaml contained 
> contradictory values for num_tokens and initial_tokens which should help 
> prevent misconfiguration via human error. The current behaviour appears to 
> differ slightly in that it performs this comparison regardless of whether 
> num_tokens is included in the yaml or not. Below are proposed patches to only 
> perform the check if both options are present in the yaml.
> ||Branch||
> |[3.0.x|https://github.com/apache/cassandra/compare/cassandra-3.0...vincewhite:num_tokens_30]|
> |[3.x|https://github.com/apache/cassandra/compare/cassandra-3.11...vincewhite:num_tokens_test_1_311]|



--
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-14477) The check of num_tokens against the length of inital_token in the yaml triggers unexpectedly

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


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

Michael Semb Wever commented on CASSANDRA-14477:


bq. dtests define num_tokens=1 for non-nvodes, here,

[~brandon.williams] was to the rescue with this 
[commit|https://github.com/apache/cassandra-dtest/commit/845a82a38d3c4bb6d14c0bdb3341bfdc36ebbb02].

> The check of num_tokens against the length of inital_token in the yaml 
> triggers unexpectedly
> 
>
> Key: CASSANDRA-14477
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14477
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Vincent White
>Assignee: Stefan Miklosovic
>Priority: Low
> Fix For: 3.0.23, 3.11.9, 4.0-beta4
>
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> In CASSANDRA-10120 we added a check that compares num_tokens against the 
> number of tokens supplied in the yaml via initial_token. From my reading of 
> CASSANDRA-10120 it was to prevent cassandra starting if the yaml contained 
> contradictory values for num_tokens and initial_tokens which should help 
> prevent misconfiguration via human error. The current behaviour appears to 
> differ slightly in that it performs this comparison regardless of whether 
> num_tokens is included in the yaml or not. Below are proposed patches to only 
> perform the check if both options are present in the yaml.
> ||Branch||
> |[3.0.x|https://github.com/apache/cassandra/compare/cassandra-3.0...vincewhite:num_tokens_30]|
> |[3.x|https://github.com/apache/cassandra/compare/cassandra-3.11...vincewhite:num_tokens_test_1_311]|



--
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-14477) The check of num_tokens against the length of inital_token in the yaml triggers unexpectedly

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


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

Michael Semb Wever commented on CASSANDRA-14477:


This broke all the {{dtest-novnode}} dtests :(

I suspect…
 - the check for num_tokens being defined should be skipped if initial_tokens 
defines only one token (as it unlikely to be a typo, folk would rarely be 
configuring two tokens),
 - {{dtest-novnode}} are run with {{--num-tokens 1}}, defined 
[here|https://github.com/apache/cassandra-builds/blob/trunk/build-scripts/cassandra-dtest-pytest.sh#L73],
 - the 
[Cassandra-devbranch|https://ci-cassandra.apache.org/view/patches/job/Cassandra-devbranch/]
 jenkins pipeline should be including {{dtest-novnode}}

> The check of num_tokens against the length of inital_token in the yaml 
> triggers unexpectedly
> 
>
> Key: CASSANDRA-14477
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14477
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Vincent White
>Assignee: Stefan Miklosovic
>Priority: Low
> Fix For: 3.0.23, 3.11.9, 4.0-beta4
>
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> In CASSANDRA-10120 we added a check that compares num_tokens against the 
> number of tokens supplied in the yaml via initial_token. From my reading of 
> CASSANDRA-10120 it was to prevent cassandra starting if the yaml contained 
> contradictory values for num_tokens and initial_tokens which should help 
> prevent misconfiguration via human error. The current behaviour appears to 
> differ slightly in that it performs this comparison regardless of whether 
> num_tokens is included in the yaml or not. Below are proposed patches to only 
> perform the check if both options are present in the yaml.
> ||Branch||
> |[3.0.x|https://github.com/apache/cassandra/compare/cassandra-3.0...vincewhite:num_tokens_30]|
> |[3.x|https://github.com/apache/cassandra/compare/cassandra-3.11...vincewhite:num_tokens_test_1_311]|



--
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-14477) The check of num_tokens against the length of inital_token in the yaml triggers unexpectedly

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


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

Michael Semb Wever commented on CASSANDRA-14477:


+1 on PRs.

CI runs for 
[3.0|https://ci-cassandra.apache.org/blue/organizations/jenkins/Cassandra-devbranch/detail/Cassandra-devbranch/210/],
 
[3.11|https://ci-cassandra.apache.org/blue/organizations/jenkins/Cassandra-devbranch/detail/Cassandra-devbranch/211/],
 and 
[trunk|https://ci-cassandra.apache.org/blue/organizations/jenkins/Cassandra-devbranch/detail/Cassandra-devbranch/212/pipeline].

> The check of num_tokens against the length of inital_token in the yaml 
> triggers unexpectedly
> 
>
> Key: CASSANDRA-14477
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14477
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Vincent White
>Assignee: Stefan Miklosovic
>Priority: Low
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> In CASSANDRA-10120 we added a check that compares num_tokens against the 
> number of tokens supplied in the yaml via initial_token. From my reading of 
> CASSANDRA-10120 it was to prevent cassandra starting if the yaml contained 
> contradictory values for num_tokens and initial_tokens which should help 
> prevent misconfiguration via human error. The current behaviour appears to 
> differ slightly in that it performs this comparison regardless of whether 
> num_tokens is included in the yaml or not. Below are proposed patches to only 
> perform the check if both options are present in the yaml.
> ||Branch||
> |[3.0.x|https://github.com/apache/cassandra/compare/cassandra-3.0...vincewhite:num_tokens_30]|
> |[3.x|https://github.com/apache/cassandra/compare/cassandra-3.11...vincewhite:num_tokens_test_1_311]|



--
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-14477) The check of num_tokens against the length of inital_token in the yaml triggers unexpectedly

2020-11-16 Thread Stefan Miklosovic (Jira)


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

Stefan Miklosovic commented on CASSANDRA-14477:
---

required changes reflected in PRs

> The check of num_tokens against the length of inital_token in the yaml 
> triggers unexpectedly
> 
>
> Key: CASSANDRA-14477
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14477
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Vincent White
>Assignee: Stefan Miklosovic
>Priority: Low
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> In CASSANDRA-10120 we added a check that compares num_tokens against the 
> number of tokens supplied in the yaml via initial_token. From my reading of 
> CASSANDRA-10120 it was to prevent cassandra starting if the yaml contained 
> contradictory values for num_tokens and initial_tokens which should help 
> prevent misconfiguration via human error. The current behaviour appears to 
> differ slightly in that it performs this comparison regardless of whether 
> num_tokens is included in the yaml or not. Below are proposed patches to only 
> perform the check if both options are present in the yaml.
> ||Branch||
> |[3.0.x|https://github.com/apache/cassandra/compare/cassandra-3.0...vincewhite:num_tokens_30]|
> |[3.x|https://github.com/apache/cassandra/compare/cassandra-3.11...vincewhite:num_tokens_test_1_311]|



--
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-14477) The check of num_tokens against the length of inital_token in the yaml triggers unexpectedly

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


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

Michael Semb Wever commented on CASSANDRA-14477:


The patch for 3.0 looks good.

My apologies, my comment about moving the section of code into a new method 
{{applyTokensConfig(Config config)}} was for all branches. Can you apply it to 
the 3.11 and trunk patches too please.

> The check of num_tokens against the length of inital_token in the yaml 
> triggers unexpectedly
> 
>
> Key: CASSANDRA-14477
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14477
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Vincent White
>Assignee: Stefan Miklosovic
>Priority: Low
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> In CASSANDRA-10120 we added a check that compares num_tokens against the 
> number of tokens supplied in the yaml via initial_token. From my reading of 
> CASSANDRA-10120 it was to prevent cassandra starting if the yaml contained 
> contradictory values for num_tokens and initial_tokens which should help 
> prevent misconfiguration via human error. The current behaviour appears to 
> differ slightly in that it performs this comparison regardless of whether 
> num_tokens is included in the yaml or not. Below are proposed patches to only 
> perform the check if both options are present in the yaml.
> ||Branch||
> |[3.0.x|https://github.com/apache/cassandra/compare/cassandra-3.0...vincewhite:num_tokens_30]|
> |[3.x|https://github.com/apache/cassandra/compare/cassandra-3.11...vincewhite:num_tokens_test_1_311]|



--
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-14477) The check of num_tokens against the length of inital_token in the yaml triggers unexpectedly

2020-11-03 Thread Stefan Miklosovic (Jira)


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

Stefan Miklosovic commented on CASSANDRA-14477:
---

[~mck] changed applied, the links with PRs are still valid, there is a link to 
each build there.

> The check of num_tokens against the length of inital_token in the yaml 
> triggers unexpectedly
> 
>
> Key: CASSANDRA-14477
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14477
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Vincent White
>Assignee: Stefan Miklosovic
>Priority: Low
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> In CASSANDRA-10120 we added a check that compares num_tokens against the 
> number of tokens supplied in the yaml via initial_token. From my reading of 
> CASSANDRA-10120 it was to prevent cassandra starting if the yaml contained 
> contradictory values for num_tokens and initial_tokens which should help 
> prevent misconfiguration via human error. The current behaviour appears to 
> differ slightly in that it performs this comparison regardless of whether 
> num_tokens is included in the yaml or not. Below are proposed patches to only 
> perform the check if both options are present in the yaml.
> ||Branch||
> |[3.0.x|https://github.com/apache/cassandra/compare/cassandra-3.0...vincewhite:num_tokens_30]|
> |[3.x|https://github.com/apache/cassandra/compare/cassandra-3.11...vincewhite:num_tokens_test_1_311]|



--
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-14477) The check of num_tokens against the length of inital_token in the yaml triggers unexpectedly

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


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

Michael Semb Wever commented on CASSANDRA-14477:


1)
Quite right! {{num_tokens}} does not end being defaulted to the {{1}} value. 

I still believe a problem still exists… (neither values, null or one) are 
correct representations to the node running.

If I have a yaml like
{code}
   initial_token: 0,256,1024
   #num_tokens:
{code}
we end up with a runtime configuration of 
{code}
config.initial_token = {0,256,1024};
config.num_tokens = null;
{code}
This isn't valid imho.

I'm thinking the code should be…
{code}
if (conf.initial_token != null)
{
Collection tokens = tokensFromString(conf.initial_token);
if (conf.num_tokens == null || tokens.size() != conf.num_tokens)
{
   throw 
}
…
{code}
Make sense?

> The check of num_tokens against the length of inital_token in the yaml 
> triggers unexpectedly
> 
>
> Key: CASSANDRA-14477
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14477
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Vincent White
>Assignee: Stefan Miklosovic
>Priority: Low
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> In CASSANDRA-10120 we added a check that compares num_tokens against the 
> number of tokens supplied in the yaml via initial_token. From my reading of 
> CASSANDRA-10120 it was to prevent cassandra starting if the yaml contained 
> contradictory values for num_tokens and initial_tokens which should help 
> prevent misconfiguration via human error. The current behaviour appears to 
> differ slightly in that it performs this comparison regardless of whether 
> num_tokens is included in the yaml or not. Below are proposed patches to only 
> perform the check if both options are present in the yaml.
> ||Branch||
> |[3.0.x|https://github.com/apache/cassandra/compare/cassandra-3.0...vincewhite:num_tokens_30]|
> |[3.x|https://github.com/apache/cassandra/compare/cassandra-3.11...vincewhite:num_tokens_test_1_311]|



--
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-14477) The check of num_tokens against the length of inital_token in the yaml triggers unexpectedly

2020-11-02 Thread Stefan Miklosovic (Jira)


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

Stefan Miklosovic commented on CASSANDRA-14477:
---

[~mck] 

1) I dont follow. 

The code in e.g. trunk branch looks like:
{code:java}
if (conf.initial_token != null)
{
Collection tokens = tokensFromString(conf.initial_token);
if (conf.num_tokens != null && tokens.size() != conf.num_tokens)
{
   throw 
}

for (String token : tokens)
partitioner.getTokenFactory().validate(token);
}
else if (conf.num_tokens == null)
{
conf.num_tokens = 1;
}
{code}
You say that   (it) demonstrates an unspecified {{num_tokens}} becomes the 
default of {{1}} but can still be combined with any number of {{initial_token}} 
values.

Is this really true? if num_tokens is not specified, it will become 1 only in 
case initial_token is null. If initial_token is not null, it will be checked on 
size against num_tokens (if it is not null) and throws only in case lenght does 
not match. Hence I do not see how it might be possible that num_tokens is set 
to 1 but initial_token might be set to wrongly.

 

 

> The check of num_tokens against the length of inital_token in the yaml 
> triggers unexpectedly
> 
>
> Key: CASSANDRA-14477
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14477
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Vincent White
>Assignee: Stefan Miklosovic
>Priority: Low
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> In CASSANDRA-10120 we added a check that compares num_tokens against the 
> number of tokens supplied in the yaml via initial_token. From my reading of 
> CASSANDRA-10120 it was to prevent cassandra starting if the yaml contained 
> contradictory values for num_tokens and initial_tokens which should help 
> prevent misconfiguration via human error. The current behaviour appears to 
> differ slightly in that it performs this comparison regardless of whether 
> num_tokens is included in the yaml or not. Below are proposed patches to only 
> perform the check if both options are present in the yaml.
> ||Branch||
> |[3.0.x|https://github.com/apache/cassandra/compare/cassandra-3.0...vincewhite:num_tokens_30]|
> |[3.x|https://github.com/apache/cassandra/compare/cassandra-3.11...vincewhite:num_tokens_test_1_311]|



--
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-14477) The check of num_tokens against the length of inital_token in the yaml triggers unexpectedly

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


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

Michael Semb Wever commented on CASSANDRA-14477:


The 
{{DatabaseDescriptorTest.testApplyInitialTokensInitialTokensSetNumTokensNotSet}}
 demonstrates an unspecified {{num_tokens}} becomes the default of {{1}} but 
can still be combined with any number of {{initial_token}} values. Are they any 
compatibility issues with changing {{DatabaseDescriptor}} to throw a 
{{ConfigurationException}} in this situation? I cannot see how any existing 
cluster would have been configured with this combination.

The 3.0 tests fail for me because of {{ConfigurationException("Missing required 
directive CommitLogSync", false)}} from {{DatabaseDescriptor.load(config)}}.

Can we move the lines (658-677) related to tokens in {{DatabaseDescriptor}} to 
a separate method, like {{applyTokensConfig(Config config)}}.
Example 
[here|https://github.com/apache/cassandra/commit/b0855523f6e80ecdffde41170a410a71380a683a]
 (ontop your 3.0 branch).








> The check of num_tokens against the length of inital_token in the yaml 
> triggers unexpectedly
> 
>
> Key: CASSANDRA-14477
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14477
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Vincent White
>Assignee: Stefan Miklosovic
>Priority: Low
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> In CASSANDRA-10120 we added a check that compares num_tokens against the 
> number of tokens supplied in the yaml via initial_token. From my reading of 
> CASSANDRA-10120 it was to prevent cassandra starting if the yaml contained 
> contradictory values for num_tokens and initial_tokens which should help 
> prevent misconfiguration via human error. The current behaviour appears to 
> differ slightly in that it performs this comparison regardless of whether 
> num_tokens is included in the yaml or not. Below are proposed patches to only 
> perform the check if both options are present in the yaml.
> ||Branch||
> |[3.0.x|https://github.com/apache/cassandra/compare/cassandra-3.0...vincewhite:num_tokens_30]|
> |[3.x|https://github.com/apache/cassandra/compare/cassandra-3.11...vincewhite:num_tokens_test_1_311]|



--
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-14477) The check of num_tokens against the length of inital_token in the yaml triggers unexpectedly

2020-10-29 Thread Stefan Miklosovic (Jira)


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

Stefan Miklosovic commented on CASSANDRA-14477:
---

3.0

[https://github.com/apache/cassandra/pull/795]

3.11

https://github.com/apache/cassandra/pull/796

trunk

https://github.com/apache/cassandra/pull/797

> The check of num_tokens against the length of inital_token in the yaml 
> triggers unexpectedly
> 
>
> Key: CASSANDRA-14477
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14477
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Vincent White
>Assignee: Stefan Miklosovic
>Priority: Low
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> In CASSANDRA-10120 we added a check that compares num_tokens against the 
> number of tokens supplied in the yaml via initial_token. From my reading of 
> CASSANDRA-10120 it was to prevent cassandra starting if the yaml contained 
> contradictory values for num_tokens and initial_tokens which should help 
> prevent misconfiguration via human error. The current behaviour appears to 
> differ slightly in that it performs this comparison regardless of whether 
> num_tokens is included in the yaml or not. Below are proposed patches to only 
> perform the check if both options are present in the yaml.
> ||Branch||
> |[3.0.x|https://github.com/apache/cassandra/compare/cassandra-3.0...vincewhite:num_tokens_30]|
> |[3.x|https://github.com/apache/cassandra/compare/cassandra-3.11...vincewhite:num_tokens_test_1_311]|



--
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-14477) The check of num_tokens against the length of inital_token in the yaml triggers unexpectedly

2019-10-10 Thread Michael Semb Wever (Jira)


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

Michael Semb Wever commented on CASSANDRA-14477:


[~VincentWhite], 
 - could you split the test method into three methods, one for each of the 
configuration scenarios being tested?
 - in the 3.11 branch could you return {{num_tokens}} to a boxed type, 
CASSANDRA-12199 only intended primitives to be used where there was a default 
value, and here you've demonstrated that there shouldn't be a default value as 
{{num_tokens}} and {{initial_token}} are exclusive,
 - and, could you rebase both branches please? (test currently fails for me 
without rebasing)

> The check of num_tokens against the length of inital_token in the yaml 
> triggers unexpectedly
> 
>
> Key: CASSANDRA-14477
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14477
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Vincent White
>Assignee: Vincent White
>Priority: Low
>
> In CASSANDRA-10120 we added a check that compares num_tokens against the 
> number of tokens supplied in the yaml via initial_token. From my reading of 
> CASSANDRA-10120 it was to prevent cassandra starting if the yaml contained 
> contradictory values for num_tokens and initial_tokens which should help 
> prevent misconfiguration via human error. The current behaviour appears to 
> differ slightly in that it performs this comparison regardless of whether 
> num_tokens is included in the yaml or not. Below are proposed patches to only 
> perform the check if both options are present in the yaml.
> ||Branch||
> |[3.0.x|https://github.com/apache/cassandra/compare/cassandra-3.0...vincewhite:num_tokens_30]|
> |[3.x|https://github.com/apache/cassandra/compare/cassandra-3.11...vincewhite:num_tokens_test_1_311]|



--
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