Skip to content
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

[BUG] cancellation_time_millis is not getting added in .tasks index #16060

Closed
soosinha opened this issue Sep 24, 2024 · 2 comments · Fixed by #16201
Closed

[BUG] cancellation_time_millis is not getting added in .tasks index #16060

soosinha opened this issue Sep 24, 2024 · 2 comments · Fixed by #16201
Labels
bug Something isn't working Other

Comments

@soosinha
Copy link
Member

soosinha commented Sep 24, 2024

Describe the bug

When a task is cancelled, the .tasks index fails to update because this index has strict dynamic mapping enabled and cancellation_time_millis field is not present in the mappings.
The exception logged is below:

[2024-09-13T20:33:48,799][WARN ][o.o.t.TaskManager        ] [8a67d3f648f0be8167ed2246724ec0d2] couldn't store response org.opensearch.replication.task.CrossClusterReplicationTask$CrossClusterReplicationTaskResponse@74ef241c
 StrictDynamicMappingException[mapping set to strict, dynamic introduction of [cancellation_time_millis] within [task] is not allowed]
         at org.opensearch.index.mapper.DocumentParser.parseDynamicValue(DocumentParser.java:835)
         at org.opensearch.index.mapper.DocumentParser.parseValue(DocumentParser.java:684)
         at org.opensearch.index.mapper.DocumentParser.innerParseObject(DocumentParser.java:457)
         at org.opensearch.index.mapper.DocumentParser.parseObjectOrNested(DocumentParser.java:415)
         at org.opensearch.index.mapper.DocumentParser.parseObjectOrField(DocumentParser.java:520)
         at org.opensearch.index.mapper.DocumentParser.parseObject(DocumentParser.java:541)
         at org.opensearch.index.mapper.DocumentParser.innerParseObject(DocumentParser.java:443)
         at org.opensearch.index.mapper.DocumentParser.parseObjectOrNested(DocumentParser.java:415)
         at org.opensearch.index.mapper.DocumentParser.internalParseDocument(DocumentParser.java:137)
         at org.opensearch.index.mapper.DocumentParser.parseDocument(DocumentParser.java:92)
         at org.opensearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:256)
         at org.opensearch.index.shard.IndexShard.prepareIndex(IndexShard.java:1188)
         at org.opensearch.index.shard.IndexShard.applyIndexOperation(IndexShard.java:1145)
         at org.opensearch.index.shard.IndexShard.applyIndexOperationOnPrimary(IndexShard.java:1062)
         at org.opensearch.action.bulk.TransportShardBulkAction.executeBulkItemRequest(TransportShardBulkAction.java:625)
         at org.opensearch.action.bulk.TransportShardBulkAction$2.doRun(TransportShardBulkAction.java:471)
         at org.opensearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:52)
         at org.opensearch.action.bulk.TransportShardBulkAction.performOnPrimary(TransportShardBulkAction.java:535)
         at org.opensearch.action.bulk.TransportShardBulkAction.dispatchedShardOperationOnPrimary(TransportShardBulkAction.java:416)
         at org.opensearch.action.bulk.TransportShardBulkAction.dispatchedShardOperationOnPrimary(TransportShardBulkAction.java:125)
         at org.opensearch.action.support.replication.TransportWriteAction$1.doRun(TransportWriteAction.java:275)
         at org.opensearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:922)
         at org.opensearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:52)
         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
         at java.lang.Thread.run(Thread.java:840)

Related component

Other

To Reproduce

  1. Create a cluster with CCR plugin
  2. Create an auto follow rule
  3. delete the auto follow rule
  4. Observe that the exception about .tasks index should appear in logs

Expected behavior

.tasks index should get updated correctly.
I see that the .tasks index is created using the mappings defined here: https://github.com/opensearch-project/OpenSearch/blob/main/server/src/main/resources/org/opensearch/tasks/task-index-mapping.json

These mappings should contain cancellation_time_millis fields as well.

Additional Details

Plugins
Please list all plugins currently enabled.
cross-cluster-replication

Screenshots
If applicable, add screenshots to help explain your problem.

Host/Environment (please complete the following information):

  • OS: [e.g. iOS]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@inpink
Copy link
Contributor

inpink commented Oct 5, 2024

Hello! I have fixed the bug and tested it. The PR has been submitted here: #16201.
Thank you for reporting such a good issue! 😄

inpink added a commit to inpink/OpenSearch that referenced this issue Oct 11, 2024
…g issue in .tasks index (opensearch-project#16060)

- Fixed issue where `.tasks` index failed to update due to StrictDynamicMappingException when a task was cancelled.
- Added missing `cancellation_time_millis` field to `task-index-mapping.json`.
- Ensured proper handling of task cancellation events in Cross-Cluster Replication (CCR) by updating the mappings.
- Verified by creating and deleting an auto follow rule without StrictDynamicMappingException.
- Changed the version in the meta field from 4 to 5 to reflect the updated mappings

Signed-off-by: inpink <[email protected]>
inpink added a commit to inpink/OpenSearch that referenced this issue Oct 11, 2024
…g issue in .tasks index (opensearch-project#16060)

- Fixed issue where `.tasks` index failed to update due to StrictDynamicMappingException when a task was cancelled.
- Added missing `cancellation_time_millis` field to `task-index-mapping.json`.
- Ensured proper handling of task cancellation events in Cross-Cluster Replication (CCR) by updating the mappings.
- Verified by creating and deleting an auto follow rule without StrictDynamicMappingException.
- Changed the version in the meta field from 4 to 5 to reflect the updated mappings

Signed-off-by: inpink <[email protected]>

Signed-off-by: inpink <[email protected]>
inpink added a commit to inpink/OpenSearch that referenced this issue Oct 11, 2024
…g issue in .tasks index (opensearch-project#16060)

- Fixed issue where `.tasks` index failed to update due to StrictDynamicMappingException when a task was cancelled.
- Added missing `cancellation_time_millis` field to `task-index-mapping.json`.
- Ensured proper handling of task cancellation events in Cross-Cluster Replication (CCR) by updating the mappings.
- Verified by creating and deleting an auto follow rule without StrictDynamicMappingException.
- Changed the version in the meta field from 4 to 5 to reflect the updated mappings

Signed-off-by: inpink <[email protected]>
inpink added a commit to inpink/OpenSearch that referenced this issue Oct 13, 2024
…tasks index (opensearch-project#16060)

- Fixed issue where `.tasks` index failed to update due to StrictDynamicMappingException when a task was cancelled.
- Added missing `cancellation_time_millis` and `resource_stats` fields to `task-index-mapping.json`.
- Ensured proper task result storage by updating the mappings.
- Changed the version in the meta field from 4 to 5 to reflect the updated mappings.

Signed-off-by: inpink <[email protected]>
Signed-off-by: inpink <[email protected]>
inpink added a commit to inpink/OpenSearch that referenced this issue Oct 13, 2024
…tasks index (opensearch-project#16060)

- Fixed issue where `.tasks` index failed to update due to StrictDynamicMappingException when a task was cancelled.
- Added missing `cancellation_time_millis` and `resource_stats` fields to `task-index-mapping.json`.
- Ensured proper task result storage by updating the mappings.
- Changed the version in the meta field from 4 to 5 to reflect the updated mappings.

Signed-off-by: inpink <[email protected]>
@dblock dblock removed the untriaged label Oct 14, 2024
@dblock
Copy link
Member

dblock commented Oct 14, 2024

[Catch All Triage - 1, 2, 3, 4]

inpink added a commit to inpink/OpenSearch that referenced this issue Oct 18, 2024
…tasks index (opensearch-project#16060)

- Fixed issue where `.tasks` index failed to update due to StrictDynamicMappingException when a task was cancelled.
- Added missing `cancellation_time_millis` and `resource_stats` fields to `task-index-mapping.json`.
- Ensured proper task result storage by updating the mappings.
- Changed the version in the meta field from 4 to 5 to reflect the updated mappings.

Signed-off-by: inpink <[email protected]>
inpink added a commit to inpink/OpenSearch that referenced this issue Oct 18, 2024
…tasks index (opensearch-project#16060)

- Fixed issue where `.tasks` index failed to update due to StrictDynamicMappingException when a task was cancelled.
- Added missing `cancellation_time_millis` and `resource_stats` fields to `task-index-mapping.json`.
- Ensured proper task result storage by updating the mappings.
- Changed the version in the meta field from 4 to 5 to reflect the updated mappings.

Signed-off-by: inpink <[email protected]>
inpink added a commit to inpink/OpenSearch that referenced this issue Oct 18, 2024
…tasks index (opensearch-project#16060)

- Fixed issue where `.tasks` index failed to update due to StrictDynamicMappingException when a task was cancelled.
- Added missing `cancellation_time_millis` and `resource_stats` fields to `task-index-mapping.json`.
- Ensured proper task result storage by updating the mappings.
- Changed the version in the meta field from 4 to 5 to reflect the updated mappings.

Signed-off-by: inpink <[email protected]>
inpink added a commit to inpink/OpenSearch that referenced this issue Oct 19, 2024
…tasks index (opensearch-project#16060)

- Fixed issue where `.tasks` index failed to update due to StrictDynamicMappingException when a task was cancelled.
- Added missing `cancellation_time_millis` and `resource_stats` fields to `task-index-mapping.json`.
- Ensured proper task result storage by updating the mappings.
- Changed the version in the meta field from 4 to 5 to reflect the updated mappings.
inpink added a commit to inpink/OpenSearch that referenced this issue Oct 19, 2024
…tasks index (opensearch-project#16060)

- Fixed issue where `.tasks` index failed to update due to StrictDynamicMappingException when a task was cancelled.
- Added missing `cancellation_time_millis` and `resource_stats` fields to `task-index-mapping.json`.
- Ensured proper task result storage by updating the mappings.
- Changed the version in the meta field from 4 to 5 to reflect the updated mappings.

Signed-off-by: inpink <[email protected]>
inpink added a commit to inpink/OpenSearch that referenced this issue Oct 19, 2024
…tasks index (opensearch-project#16060)

- Fixed issue where `.tasks` index failed to update due to StrictDynamicMappingException when a task was cancelled.
- Added missing `cancellation_time_millis` and `resource_stats` fields to `task-index-mapping.json`.
- Ensured proper task result storage by updating the mappings.
- Changed the version in the meta field from 4 to 5 to reflect the updated mappings.

Signed-off-by: inpink <[email protected]>
inpink added a commit to inpink/OpenSearch that referenced this issue Oct 19, 2024
…tasks index (opensearch-project#16060)

- Fixed issue where `.tasks` index failed to update due to StrictDynamicMappingException when a task was cancelled.
- Added missing `cancellation_time_millis` and `resource_stats` fields to `task-index-mapping.json`.
- Ensured proper task result storage by updating the mappings.
- Changed the version in the meta field from 4 to 5 to reflect the updated mappings.

Signed-off-by: inpink <[email protected]>
inpink added a commit to inpink/OpenSearch that referenced this issue Oct 20, 2024
…tasks index (opensearch-project#16060)

- Fixed issue where `.tasks` index failed to update due to StrictDynamicMappingException when a task was cancelled.
- Added missing `cancellation_time_millis` and `resource_stats` fields to `task-index-mapping.json`.
- Ensured proper task result storage by updating the mappings.
- Changed the version in the meta field from 4 to 5 to reflect the updated mappings.

Signed-off-by: inpink <[email protected]>
inpink added a commit to inpink/OpenSearch that referenced this issue Oct 20, 2024
…tasks index (opensearch-project#16060)

- Fixed issue where `.tasks` index failed to update due to StrictDynamicMappingException when a task was cancelled.
- Added missing `cancellation_time_millis` and `resource_stats` fields to `task-index-mapping.json`.
- Ensured proper task result storage by updating the mappings.
- Changed the version in the meta field from 4 to 5 to reflect the updated mappings.

Signed-off-by: inpink <[email protected]>
dbwiddis added a commit that referenced this issue Oct 21, 2024
…tasks index (#16060) (#16201)

- Fixed issue where `.tasks` index failed to update due to StrictDynamicMappingException when a task was cancelled.
- Added missing `cancellation_time_millis` and `resource_stats` fields to `task-index-mapping.json`.
- Ensured proper task result storage by updating the mappings.
- Changed the version in the meta field from 4 to 5 to reflect the updated mappings.

Signed-off-by: inpink <[email protected]>
Signed-off-by: Daniel Widdis <[email protected]>
Co-authored-by: Daniel Widdis <[email protected]>
dbwiddis added a commit to dbwiddis/OpenSearch that referenced this issue Oct 21, 2024
…tasks index (opensearch-project#16060) (opensearch-project#16201)

- Fixed issue where `.tasks` index failed to update due to StrictDynamicMappingException when a task was cancelled.
- Added missing `cancellation_time_millis` and `resource_stats` fields to `task-index-mapping.json`.
- Ensured proper task result storage by updating the mappings.
- Changed the version in the meta field from 4 to 5 to reflect the updated mappings.

Signed-off-by: inpink <[email protected]>
Signed-off-by: Daniel Widdis <[email protected]>
Co-authored-by: Daniel Widdis <[email protected]>
dbwiddis added a commit that referenced this issue Oct 22, 2024
…tasks index (#16060) (#16201) (#16414)

- Fixed issue where `.tasks` index failed to update due to StrictDynamicMappingException when a task was cancelled.
- Added missing `cancellation_time_millis` and `resource_stats` fields to `task-index-mapping.json`.
- Ensured proper task result storage by updating the mappings.
- Changed the version in the meta field from 4 to 5 to reflect the updated mappings.

Signed-off-by: inpink <[email protected]>
Signed-off-by: Daniel Widdis <[email protected]>
Co-authored-by: inpink <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Other
Projects
None yet
3 participants