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

Paulo Motta commented on CASSANDRA-10130:
-----------------------------------------

bq. To complement SecondaryIndexManager#markIndexBuilt and 
SecondaryIndexManager#markIndexRemoved I have added a new method 
SecondaryIndexManager#markIndexBuilding to be called before any index 
(re)building. 

The approach looks good, but do we really need a {{PendingIndexBuildsCounter}} 
class? I thought it would be simpler to make {{pendingBuilds}} a {{Map<String, 
AtomicInteger>}} and keep the inc/dec logic on {{markIndexBuilding}} and 
{{markIndexBuilt}} instead, which are the only consumers of this class.

bq. Also, it's worth noting that, with this approach, if any (re)building fails 
for a index, it will get inevitably marked for rebuilding at restart, even if 
an index rebuilding is manually run. Should we avoid this? If so, how could we 
avoid race conditions between these manual (re)buildings and those produced by 
streaming?

Hmm that is a bit less than ideal, since the user will expect the index *NOT* 
to be rebuilt on restart if there was a subsequent successful rebuild. How 
about making {{markIndexBuilding}} return the current counter value, and on 
full index rebuilds we could pass the value to {{markIndexBuilt}}, and if it's 
the same as before we could assume no new partial or full rebuild was submitted 
in-between and so we can mark the index as built and reset/remove the counters?

bq. I'm not sure about if the assert in 
SecondaryIndexManager.PendingIndexBuildsCounter#decrease() is too aggressive.

The previous API did not require users to call {{markIndexBuilding}} before 
{{markIndexBuilt}}, so we should probably leave the {{markIndexBuilt}} API with 
the current unsafe behavior (while marking it as deprecated), and add the 
assertion only on the new API. WDYT?

> Node failure during 2i update after streaming can have incomplete 2i when 
> restarted
> -----------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-10130
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-10130
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Coordination
>            Reporter: Yuki Morishita
>            Assignee: Andrés de la Peña
>            Priority: Minor
>
> Since MV/2i update happens after SSTables are received, node failure during 
> MV/2i update can leave received SSTables live when restarted while MV/2i are 
> partially up to date.
> We can add some kind of tracking mechanism to automatically rebuild at the 
> startup, or at least warn user when the node restarts.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to