-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Deprecate indices without soft-deletes #50502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,7 @@ | |
import org.elasticsearch.common.ValidationException; | ||
import org.elasticsearch.common.compress.CompressedXContent; | ||
import org.elasticsearch.common.io.PathUtils; | ||
import org.elasticsearch.common.logging.DeprecationLogger; | ||
import org.elasticsearch.common.settings.IndexScopedSettings; | ||
import org.elasticsearch.common.settings.Setting; | ||
import org.elasticsearch.common.settings.Settings; | ||
|
@@ -62,6 +63,7 @@ | |
import org.elasticsearch.index.Index; | ||
import org.elasticsearch.index.IndexNotFoundException; | ||
import org.elasticsearch.index.IndexService; | ||
import org.elasticsearch.index.IndexSettings; | ||
import org.elasticsearch.index.mapper.DocumentMapper; | ||
import org.elasticsearch.index.mapper.MapperService; | ||
import org.elasticsearch.index.mapper.MapperService.MergeReason; | ||
|
@@ -102,6 +104,7 @@ | |
*/ | ||
public class MetaDataCreateIndexService { | ||
private static final Logger logger = LogManager.getLogger(MetaDataCreateIndexService.class); | ||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(logger); | ||
|
||
public static final int MAX_INDEX_NAME_BYTES = 255; | ||
|
||
|
@@ -434,6 +437,11 @@ static Settings aggregateIndexSettings(ClusterState currentState, CreateIndexClu | |
* that will be used to create this index. | ||
*/ | ||
MetaDataCreateIndexService.checkShardLimit(indexSettings, currentState); | ||
if (indexSettings.getAsBoolean(IndexSettings.INDEX_SOFT_DELETES_SETTING.getKey(), true) == false) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we want to completely disallow setting this setting in 8.x? If so, should we always emit a warning, even if it's explicitly set to true? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Users might be confused about the deprecation when creating indices for CCR in a mixed cluster between 7.x and 6.8 because they need to explicitly set the soft_deletes setting. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If mixed clusters with 6.8 is a worry, you can just check here that all nodes are 7.0+. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ++. I will make this change in a follow-up. |
||
DEPRECATION_LOGGER.deprecatedAndMaybeLog("soft_deletes_disabled", | ||
"Creating indices with soft-deletes disabled is deprecated and will be removed in future Elasticsearch versions. " + | ||
"Please do not specify value for setting [index.soft_deletes.enabled] of index [" + request.index() + "]."); | ||
} | ||
return indexSettings; | ||
} | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.