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

sankalp kohli commented on CASSANDRA-6621:
------------------------------------------

"What if we just special cased LCS during bootstrap to just put streamed data 
into the first level it doesn't overlap"
I agree this will be better but here is another optional improvement which can 
minimize stables in L0. 

Stream stables from the source by sorting them by level which will cause 
streaming of stables in following order L1 to Lx and then finally L0. Here is 
why this will help. 
1) If we stream an stable from higher level first, it will take a plot in L1 
and will kick other stables to higher levels or to even L0. 
2) If L0 of the streaming node is backed up and has 20-30 stables, it might end 
up in filling X levels and will kick other stables to L0 due to overlapping. 
Streaming L0 in the end will help in this case. 

Also I find it cleaner just to visualize that Level Z stables will go in Level 
Z on the node being bootstrapped.
""where X is calculated from total dataset being streamed"
Also I am not sure whether doing the sort based improvement which I am 
proposing will result in limited number of levels in the bootstrapping node. If 
node is bootstrapping from node A and B and A has 5 levels and B has 3 levels. 
The bootstrap node will have 5 levels. So we might not need to calculate X() 



> STCS fallback is not optimal when bootstrapping
> -----------------------------------------------
>
>                 Key: CASSANDRA-6621
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6621
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Bartłomiej Romański
>            Priority: Minor
>
> The initial discussion started in (closed) CASSANDRA-5371. I've rewritten my 
> last comment here...
> After streaming (e.g. during boostrap) Cassandra places all sstables at L0. 
> At the end of the process we end up with huge number of sstables at the 
> lowest level. 
> Currently, Cassandra falls back to STCS until the number of sstables at L0 
> reaches the reasonable level (32 or something).
> I'm not sure if falling back to STCS is the best way to handle this 
> particular situation. I've read the comment in the code and I'm aware why it 
> is a good thing to do if we have to many sstables at L0 as a result of too 
> many random inserts. We have a lot of sstables, each of them covers the whole 
> ring, there's simply no better option.
> However, after the bootstrap situation looks a bit different. The loaded 
> sstables already have very small ranges! We just have to tidy up a bit and 
> everything should be OK. STCS ignores that completely and after a while we 
> have a bit less sstables but each of them covers the whole ring instead of 
> just a small part. I believe that in that case letting LCS do the job is a 
> better option that allowing STCS mix everything up before.
> Is there a way to disable STCS fallback? I'd like to test that scenario in 
> practice during our next bootstrap...
> Does Cassandra really have to put streamed sstables at L0? The only thing we 
> have to assure is that sstables at any given level do not overlap. If we 
> stream different regions from different nodes how can we get any overlaps?



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to