[improvement](inverted index) Disable the use of skipping write index on load (#34719)

When `skip_write_index_on_load` is turned on, users will get an error when querying for the latest data(not compacted), giving them a bad experience. And we can use `inverted_index_ram_dir_enable = true` and `inverted_index_storage_format=V2` to reduce IO and CPU consumption. So we disable it now.

1. Disable setting `skip_write_index_on_load` to `true` in create table stmt.
2. Disable setting `skip_write_index_on_load` to `true` in alter table properties stmt. You can still alter `skip_write_index_on_load` to `false`.

Co-authored-by: Luennng <luennng@gmail.com>
This commit is contained in:
qiye
2024-05-13 15:27:51 +08:00
committed by yiguolei
parent 1545d96617
commit b6409f5584
4 changed files with 9 additions and 4 deletions

View File

@ -240,6 +240,11 @@ public class ModifyTablePropertiesClause extends AlterTableClause {
this.needTableStable = false;
this.opType = AlterOpType.MODIFY_TABLE_PROPERTY_SYNC;
} else if (properties.containsKey(PropertyAnalyzer.PROPERTIES_SKIP_WRITE_INDEX_ON_LOAD)) {
if (properties.get(PropertyAnalyzer.PROPERTIES_SKIP_WRITE_INDEX_ON_LOAD).equalsIgnoreCase("true")) {
throw new AnalysisException(
"Property "
+ PropertyAnalyzer.PROPERTIES_SKIP_WRITE_INDEX_ON_LOAD + " is forbidden now");
}
if (!properties.get(PropertyAnalyzer.PROPERTIES_SKIP_WRITE_INDEX_ON_LOAD).equalsIgnoreCase("true")
&& !properties.get(PropertyAnalyzer
.PROPERTIES_SKIP_WRITE_INDEX_ON_LOAD).equalsIgnoreCase("false")) {

View File

@ -705,7 +705,8 @@ public class PropertyAnalyzer {
}
properties.remove(PROPERTIES_SKIP_WRITE_INDEX_ON_LOAD);
if (value.equalsIgnoreCase("true")) {
return true;
throw new AnalysisException("Property " + PROPERTIES_SKIP_WRITE_INDEX_ON_LOAD
+ " is forbidden now.");
} else if (value.equalsIgnoreCase("false")) {
return false;
}

View File

@ -2405,8 +2405,7 @@ public class InternalCatalog implements CatalogIf<Database> {
olapTable.setStoreRowColumn(storeRowColumn);
// set skip inverted index on load
boolean skipWriteIndexOnLoad = PropertyAnalyzer.analyzeBooleanProp(properties,
PropertyAnalyzer.PROPERTIES_SKIP_WRITE_INDEX_ON_LOAD, false);
boolean skipWriteIndexOnLoad = PropertyAnalyzer.analyzeSkipWriteIndexOnLoad(properties);
olapTable.setSkipWriteIndexOnLoad(skipWriteIndexOnLoad);
boolean isMutable = PropertyAnalyzer.analyzeBooleanProp(properties, PropertyAnalyzer.PROPERTIES_MUTABLE, true);