-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
[7.x] Deprecate Auto-Follow system indices #73237
Changes from 9 commits
9b8adc0
f38bc7a
7e8d53e
8804d9d
f4967e5
a48b770
69910d7
d895be7
9066e41
790a09f
88d5188
19cae57
28918ce
08b3641
3a6cc0b
3045ead
962a747
36d81a6
a949a91
74c289b
b80e0e9
6a9edf8
8727ce5
0573217
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 |
---|---|---|
|
@@ -132,9 +132,7 @@ | |
public class Ccr extends Plugin implements ActionPlugin, PersistentTaskPlugin, EnginePlugin, RepositoryPlugin, ClusterPlugin { | ||
|
||
public static final String CCR_THREAD_POOL_NAME = "ccr"; | ||
public static final String CCR_CUSTOM_METADATA_KEY = "ccr"; | ||
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. Perhaps leave a comment here, stating that these moved to CcrConstants in 7.x (since this targets 7.x only)? 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. Addressed in b80e0e9 |
||
public static final String CCR_CUSTOM_METADATA_LEADER_INDEX_SHARD_HISTORY_UUIDS = "leader_index_shard_history_uuids"; | ||
public static final String CCR_CUSTOM_METADATA_LEADER_INDEX_UUID_KEY = "leader_index_uuid"; | ||
public static final String CCR_CUSTOM_METADATA_LEADER_INDEX_NAME_KEY = "leader_index_name"; | ||
public static final String CCR_CUSTOM_METADATA_REMOTE_CLUSTER_NAME_KEY = "remote_cluster_name"; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,12 +38,12 @@ | |
import org.elasticsearch.index.IndexSettings; | ||
import org.elasticsearch.license.LicenseUtils; | ||
import org.elasticsearch.transport.NoSuchRemoteClusterException; | ||
import org.elasticsearch.xpack.ccr.Ccr; | ||
import org.elasticsearch.xpack.ccr.CcrLicenseChecker; | ||
import org.elasticsearch.xpack.ccr.CcrSettings; | ||
import org.elasticsearch.xpack.core.ccr.AutoFollowMetadata; | ||
import org.elasticsearch.xpack.core.ccr.AutoFollowMetadata.AutoFollowPattern; | ||
import org.elasticsearch.xpack.core.ccr.AutoFollowStats; | ||
import org.elasticsearch.xpack.core.ccr.CcrConstants; | ||
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 think we should add a check to (not related to the line the comment is on). |
||
import org.elasticsearch.xpack.core.ccr.action.PutFollowAction; | ||
import org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshotsConstants; | ||
|
||
|
@@ -555,9 +555,9 @@ private static boolean leaderIndexAlreadyFollowed(AutoFollowPattern autoFollowPa | |
// we should let the auto follower attempt to auto follow it, so it can fail later and | ||
// it is then visible in the auto follow stats. For example a cluster can just happen to have | ||
// an index with the same name as the new follower index. | ||
Map<String, String> customData = indexMetadata.getCustomData(Ccr.CCR_CUSTOM_METADATA_KEY); | ||
Map<String, String> customData = indexMetadata.getCustomData(CcrConstants.CCR_CUSTOM_METADATA_KEY); | ||
if (customData != null) { | ||
String recordedLeaderIndexUUID = customData.get(Ccr.CCR_CUSTOM_METADATA_LEADER_INDEX_UUID_KEY); | ||
String recordedLeaderIndexUUID = customData.get(CcrConstants.CCR_CUSTOM_METADATA_LEADER_INDEX_UUID_KEY); | ||
return leaderIndex.getUUID().equals(recordedLeaderIndexUUID); | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,8 @@ | |
import org.elasticsearch.cluster.metadata.Metadata; | ||
import org.elasticsearch.cluster.service.ClusterService; | ||
import org.elasticsearch.common.inject.Inject; | ||
import org.elasticsearch.common.logging.DeprecationCategory; | ||
import org.elasticsearch.common.logging.DeprecationLogger; | ||
import org.elasticsearch.common.settings.Settings; | ||
import org.elasticsearch.license.LicenseUtils; | ||
import org.elasticsearch.threadpool.ThreadPool; | ||
|
@@ -44,6 +46,8 @@ | |
|
||
public class TransportPutAutoFollowPatternAction extends AcknowledgedTransportMasterNodeAction<PutAutoFollowPatternAction.Request> { | ||
|
||
private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(TransportPutAutoFollowPatternAction.class); | ||
|
||
private final Client client; | ||
private final CcrLicenseChecker ccrLicenseChecker; | ||
|
||
|
@@ -196,6 +200,12 @@ private static void markExistingIndicesAsAutoFollowed( | |
for (final IndexMetadata indexMetadata : leaderMetadata) { | ||
IndexAbstraction indexAbstraction = leaderMetadata.getIndicesLookup().get(indexMetadata.getIndex().getName()); | ||
if (AutoFollowPattern.match(patterns, indexAbstraction)) { | ||
if (indexAbstraction.isSystem()) { | ||
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 am torn on this. I think the logic here ensures that we do not follow these existing system indices anyway and therefore it hardly makes sense to have the deprecation warning here? I would opt to remove it. 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. My thinking here was that we'll deprecate this behaviour in |
||
deprecationLogger.deprecate(DeprecationCategory.INDICES, | ||
"ccr_auto_follow_system_indices", | ||
"Auto following a system index " + indexMetadata.getIndex() + " will not work in the next major version" | ||
); | ||
} | ||
followedIndexUUIDS.add(indexMetadata.getIndexUUID()); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should add a note on how to adapt to 8.0 behavior, by excluding patterns matching system indices like
.tasks
and.kibana-*
.