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

Sam Tunnicliffe commented on CASSANDRA-12039:
---------------------------------------------

Thanks, the updated patch is looking good. If you amend slightly the new log 
statement in {{SIM}} to include the value being passed in, we can properly 
check that in a dtest. Otherwise, modulo the couple of nits below I think we'll 
be good to go once we get some dtests in place. 

One thing that we should note is that when pre-join tasks are executed as a 
result of manually joining (i.e. start in write survey mode, then join via 
nodetool/JMX), the value of the bootstrap flag is always false. Obviously, this 
might not always be accurate as a node can perfectly well start up in survey 
mode but also perform bootstrap before an operator joins it. Short of exposing 
the overload of {{joinRing}} and extending the nodetool join command, I'm not 
sure there's any practical solution to this. However, I guess this is quite a 
niche scenario, so I suggest that clearly documenting this limitation in 
{{NEWS.txt}} is sufficient. Would you mind adding an entry to {{NEWS.txt}} 
please?

Nits: 

The filter condition in {{StorageService::executePreJoinTasks}} can be 
streamlined to:
{code}
.filter(cfs -> 
Schema.instance.getUserKeyspaces().contains(cfs.keyspace.getName()))
{code}

{{SIM::executeAllBlocking}} handles null {{Callable}} correctly, so the default 
impl of {{getPreJoinTask}} can just return {{null}} rather than a task which 
returns {{null}}.

There's a couple of other minor formatting things, but I can fix those on 
commit.


> Add an index callback to be notified post bootstrap and before joining the 
> ring
> -------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-12039
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-12039
>             Project: Cassandra
>          Issue Type: New Feature
>            Reporter: Sergio Bossa
>            Assignee: Sergio Bossa
>
> Custom index implementations might need to be notified when the node finishes 
> bootstrapping in order to execute some blocking tasks before the node itself 
> goes into NORMAL state.
> This is a proposal to add such functionality, which should roughly require 
> the following:
> 1) Add a {{getPostBootstrapTask}} callback to the {{Index}} interface.
> 2) Add an {{executePostBootstrapBlockingTasks}} method to 
> {{SecondaryIndexManager}} calling into the previously mentioned callback.
> 3) Hook that into {{StorageService#joinTokenRing}}.
> Thoughts?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to