Hi all,

We are working with cassandra 3.0.14 using secondary indexes and we realized 
that it's not possible to create several index simultaneously, in fact you can 
send several "CREATE CUSTOM INDEX..." statements but cassandra doesn't start to 
build one index until the previous one has been completely built.

I've been analyzing how index creation is managed by Cassandra and I found the 
following:
SecondaryIndexManager class uses an "asynExecutor" to execute the 
initialization index task, the asynExecutor object is initialized this way:
private static final ExecutorService asyncExecutor =
        new JMXEnabledThreadPoolExecutor(1,
                                         StageManager.KEEPALIVE,
                                         TimeUnit.SECONDS,
                                         new LinkedBlockingQueue<>(),
                                         new 
NamedThreadFactory("SecondaryIndexManagement"),
                                         "internal");

So the asynExecutor is being created with a corePoolSize=1 and 
maximumPoolSize=1 and this is the reason while the index creation tasks are 
being serialized.
I've been able to change coreThreads and maximumThreads for this executor via 
jmx but I haven't found any other way to modify the size of this pool and I 
don't know the reason why this pool is set with "fixed" size 1.

Is it possible to change the pool size in any other way?
Could there be a concurrency problem if several index are created in parallel 
and is this the reason why the pool size is set to 1?

Thanks in advance.
Best regards.

Reply via email to