Skip to content

Add termination time to TaskStats#7479

Closed
kevinwilfong wants to merge 1 commit intofacebookincubator:mainfrom
kevinwilfong:export-D51140307
Closed

Add termination time to TaskStats#7479
kevinwilfong wants to merge 1 commit intofacebookincubator:mainfrom
kevinwilfong:export-D51140307

Conversation

@kevinwilfong
Copy link
Contributor

Summary:
Like the title says, store termination time, separately from execution end time, in the TaskStats.

The reason for needing termination time comes from Presto. They currently use execution end time to determine when a task was last used and clean up the Task once it's terminated and after some threshold of time after the end time. If a task has partitioned output, that output may not be fully consumed until some time after the execution end time. Termination time is guaranteed to be after the partitioned output has been consumed (assuming the query is running successfully), and so it's a better reflection of how long ago the task was used.

Today we see that for some queries, the execution end time is long before the termination time, and so Presto will delete the task as soon as it's terminated. This leads to issues with in flight status checks Presto makes against the Worker.

Differential Revision: D51140307

Summary:
Like the title says, store termination time, separately from execution end time, in the TaskStats.

The reason for needing termination time comes from Presto.  They currently use execution end time to determine when a task was last used and clean up the Task once it's terminated and after some threshold of time after the end time.  If a task has partitioned output, that output may not be fully consumed until some time after the execution end time.  Termination time is guaranteed to be after the partitioned output has been consumed (assuming the query is running successfully), and so it's a better reflection of how long ago the task was used.

Today we see that for some queries, the execution end time is long before the termination time, and so Presto will delete the task as soon as it's terminated.  This leads to issues with in flight status checks Presto makes against the Worker.

Differential Revision: D51140307
@netlify
Copy link

netlify bot commented Nov 9, 2023

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit e55a9d9
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/654c35244ccb9300083d41e8

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported labels Nov 9, 2023
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51140307

Copy link
Contributor

@xiaoxmeng xiaoxmeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kevinwilfong thanks for the change!

if (taskStats_.executionEndTimeMs == 0) {
taskStats_.executionEndTimeMs = getCurrentTimeMs();
}
if (taskStats_.terminationTimeMs == 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add unit test for this new timestamp? thanks!

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 8ff8d7a.

@conbench-facebook
Copy link

Conbench analyzed the 1 benchmark run on commit 8ff8d7a0.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

kevinwilfong added a commit to kevinwilfong/presto that referenced this pull request Nov 9, 2023
To pull in facebookincubator/velox#7479 which
we can use to address some errors we've been seeing when the
Coordinator gets the status from the Worker.
amitkdutta pushed a commit to prestodb/presto that referenced this pull request Nov 10, 2023
To pull in facebookincubator/velox#7479 which
we can use to address some errors we've been seeing when the
Coordinator gets the status from the Worker.
wypb pushed a commit to wypb/presto that referenced this pull request Dec 22, 2023
To pull in facebookincubator/velox#7479 which
we can use to address some errors we've been seeing when the
Coordinator gets the status from the Worker.
kaikalur pushed a commit to kaikalur/presto that referenced this pull request Mar 14, 2024
To pull in facebookincubator/velox#7479 which
we can use to address some errors we've been seeing when the
Coordinator gets the status from the Worker.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants