mirror of https://github.com/apache/cassandra
Provide truncate task for SAI
If a table is truncated during the initial build of an index there is a chance that the index build will get interrupted and it won't get marked queryable. This patch provides a truncate task for SAI that marks the index queryable during truncation. patch by Mike Adamson; reviewed by Caleb Rackliffe, Michael Semb Wever for CASSANDRA-19032
This commit is contained in:
parent
3396ce9f08
commit
3928f2992f
|
|
@ -1,4 +1,5 @@
|
|||
5.0-beta1
|
||||
* SAI indexes are marked queryable during truncation (CASSANDRA-19032)
|
||||
* Enable Direct-IO feature for CommitLog files using Java native API's. (CASSANDRA-18464)
|
||||
* SAI fixes for composite partitions, and static and non-static rows intersections (CASSANDRA-19034)
|
||||
* Improve SAI IndexContext handling of indexed and non-indexed columns in queries (CASSANDRA-18166)
|
||||
|
|
|
|||
|
|
@ -390,10 +390,15 @@ public class StorageAttachedIndex implements Index
|
|||
public Callable<?> getTruncateTask(long truncatedAt)
|
||||
{
|
||||
/*
|
||||
* index files will be removed as part of base sstable lifecycle in
|
||||
* {@link LogTransaction#delete(java.io.File)} asynchronously.
|
||||
* index files will be removed as part of base sstable lifecycle in {@link LogTransaction#delete(java.io.File)}
|
||||
* asynchronously, but we need to mark the index queryable because if the truncation is during the initial
|
||||
* build of the index it won't get marked queryable by the build.
|
||||
*/
|
||||
return null;
|
||||
return () -> {
|
||||
logger.info(indexIdentifier.logMessage("Making index queryable during table truncation"));
|
||||
baseCfs.indexManager.makeIndexQueryable(this, Status.BUILD_SUCCEEDED);
|
||||
return null;
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in New Issue