Skip to content

Conversation

@nmesot
Copy link

@nmesot nmesot commented Jun 20, 2024

When a task can not be assigned, the ptask framework is able to message back a reason in form of a string. This feature also started to be used for successful assignments, for example in the task that ads a health node.

Callers might need to interpret an assignment failure to e.g. return a HTTP status code. A string is hard to interpret and therefore not suitable.

Therefore, the Assignment can now take a programmer friendly code. It is still possible to provide a freetext String, as some context dependent information (e.g. nodeId) can not be stored in an Enum. Because some tasks provided multiple reasons for being unable to assign (all concatenated in a string), it is possible to provide multiple codes.

This commit also adapted the serialization and deserialization methods for backwards compatibility.

Closes #53711

@elasticsearchmachine elasticsearchmachine added needs:triage Requires assignment of a team area label v8.15.0 external-contributor Pull request authored by a developer outside the Elasticsearch team labels Jun 20, 2024
@kingherc kingherc added :Distributed Coordination/Task Management Issues for anything around the Tasks API - both persistent and node level. Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. labels Jun 21, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

@elasticsearchmachine elasticsearchmachine removed the needs:triage Requires assignment of a team area label label Jun 21, 2024
@nmesot nmesot marked this pull request as draft July 7, 2024 18:33
@nmesot
Copy link
Author

nmesot commented Jul 7, 2024

One test failed once after 10 runs, I will update this PR after I figure out why

@nmesot nmesot force-pushed the feat/improve-persistent-task branch from 6cd602c to 825e643 Compare July 11, 2024 11:02
…c#53711)

When a task can not be assigned, the ptask framework is able to message back a reason in form of a string. This feature is also used for successful assignments, for example in the task that ads a health node.

Callers might need to interpret an assignment failure to e.g. return a HTTP status code. A string is hard to interpret and therefore not suitable.

Therefore, the Assignment can now take a programmer friendly code. It is still possible to provide a freetext String, as some context dependent information (e.g. nodeId) can not be stored in an Enum. Because some tasks provided multiple reasons for being unable to assign (all concatenated in a string), it is possible to provide multiple codes.

This commit also adapted the serialization and deserialization methods for backwards compatibility.

Closes elastic#53711
@nmesot nmesot force-pushed the feat/improve-persistent-task branch from 825e643 to 1925187 Compare July 11, 2024 16:15
@nmesot nmesot marked this pull request as ready for review July 11, 2024 16:50
@nmesot
Copy link
Author

nmesot commented Jul 11, 2024

I managed to fix the broken test, PR is ready for review. Pinging @elastic/es-distributed (Team:Distributed)

@elasticsearchmachine elasticsearchmachine added v9.1.0 Team:Distributed Coordination Meta label for Distributed Coordination team and removed v9.0.0 labels Jan 30, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed-obsolete (Team:Distributed (Obsolete))

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed Coordination/Task Management Issues for anything around the Tasks API - both persistent and node level. external-contributor Pull request authored by a developer outside the Elasticsearch team Team:Distributed Coordination Meta label for Distributed Coordination team Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve reason for PersistentTasksCustomMetaData.Assignment

4 participants