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

[1.9] Update evaluation id logic to be in sync with tick ids #25269

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

OwenKephart
Copy link
Contributor

Summary & Motivation

When running in user-code mode, evaluation ids are always based off of the tick id. This prevents us from having to deserialize the AssetDaemonCursor server side, and just in general is an easier way of producing monotonically increasing integers across multiple values.

In general, the tick id is guaranteed to be strictly larger than the AssetDaemonCursor value, as the daemon cursor (unless manually edited) cannot increase without a new tick being created. This means that it is safe to switch from daemon-mode to user-mode, but if you switch from user-mode back to daemon-mode, you could end up with an evaluation id that was much smaller, with the end result being that new evaluation records you produce would have a lower evaluation_id than older ones, messing up the history.

This change makes it so that the daemon-mode id will stay in sync with the tick id, avoiding this issue.

How I Tested These Changes

Existing tests, with some small updates.

Changelog

NOCHANGELOG

Copy link
Contributor Author

OwenKephart commented Oct 14, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @OwenKephart and the rest of your teammates on Graphite Graphite

@OwenKephart OwenKephart requested a review from gibsondan October 14, 2024 22:57
@OwenKephart OwenKephart force-pushed the 10-10-create_default_automation_condition_sensor_in_definitions_object branch from ad63e1b to a539d0e Compare October 14, 2024 23:02
@OwenKephart OwenKephart force-pushed the 10-14-_wip_update_evaluation_id_logic branch from 0d03b8a to 6f38e2c Compare October 14, 2024 23:03
@OwenKephart OwenKephart force-pushed the 10-10-create_default_automation_condition_sensor_in_definitions_object branch from a539d0e to 9e40e7a Compare October 14, 2024 23:11
@OwenKephart OwenKephart force-pushed the 10-14-_wip_update_evaluation_id_logic branch from 6f38e2c to ea5f33c Compare October 14, 2024 23:11
@OwenKephart OwenKephart force-pushed the 10-10-create_default_automation_condition_sensor_in_definitions_object branch from 9e40e7a to 0eccef5 Compare October 15, 2024 17:33
@OwenKephart OwenKephart force-pushed the 10-14-_wip_update_evaluation_id_logic branch from ea5f33c to 9649d9d Compare October 15, 2024 17:33
@OwenKephart OwenKephart force-pushed the 10-10-create_default_automation_condition_sensor_in_definitions_object branch from 0eccef5 to a57483a Compare October 15, 2024 17:56
@OwenKephart OwenKephart force-pushed the 10-14-_wip_update_evaluation_id_logic branch from 9649d9d to 51521fd Compare October 15, 2024 17:56
@OwenKephart OwenKephart force-pushed the 10-10-create_default_automation_condition_sensor_in_definitions_object branch from a57483a to bb8b0f1 Compare October 15, 2024 18:59
@OwenKephart OwenKephart force-pushed the 10-14-_wip_update_evaluation_id_logic branch from 51521fd to 4fe29d2 Compare October 15, 2024 19:00
@OwenKephart OwenKephart force-pushed the 10-10-create_default_automation_condition_sensor_in_definitions_object branch from bb8b0f1 to 99f09d6 Compare October 15, 2024 21:09
@OwenKephart OwenKephart force-pushed the 10-10-create_default_automation_condition_sensor_in_definitions_object branch from 8bd71f8 to fdd6922 Compare October 17, 2024 16:39
@OwenKephart OwenKephart force-pushed the 10-14-_wip_update_evaluation_id_logic branch 2 times, most recently from 4804b8b to 7c398a7 Compare October 17, 2024 18:02
@OwenKephart OwenKephart changed the base branch from 10-10-create_default_automation_condition_sensor_in_definitions_object to 10-17-add-automation-condition-to-observable-source-asset October 17, 2024 18:02
Copy link
Member

@gibsondan gibsondan left a comment

Choose a reason for hiding this comment

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

see inline re: write perf

@OwenKephart OwenKephart force-pushed the 10-17-add-automation-condition-to-observable-source-asset branch from 1ebe066 to 72af2ad Compare October 21, 2024 23:05
@OwenKephart OwenKephart force-pushed the 10-14-_wip_update_evaluation_id_logic branch from 7c398a7 to 2fa690e Compare October 21, 2024 23:05
@OwenKephart OwenKephart dismissed gibsondan’s stale review October 21, 2024 23:31

updated as suggested!

@OwenKephart OwenKephart requested a review from gibsondan October 21, 2024 23:31
@OwenKephart OwenKephart force-pushed the 10-17-add-automation-condition-to-observable-source-asset branch from 72af2ad to 153df0d Compare October 22, 2024 00:25
@OwenKephart OwenKephart force-pushed the 10-14-_wip_update_evaluation_id_logic branch from 2fa690e to 7863f83 Compare October 22, 2024 00:25
@OwenKephart OwenKephart force-pushed the 10-17-add-automation-condition-to-observable-source-asset branch from 153df0d to 858cde1 Compare October 22, 2024 16:49
@OwenKephart OwenKephart force-pushed the 10-14-_wip_update_evaluation_id_logic branch from 7863f83 to 7d69c4a Compare October 22, 2024 16:49
@OwenKephart OwenKephart force-pushed the 10-17-add-automation-condition-to-observable-source-asset branch from 858cde1 to 93d0b9b Compare October 22, 2024 17:06
@OwenKephart OwenKephart force-pushed the 10-14-_wip_update_evaluation_id_logic branch from 7d69c4a to dbe2739 Compare October 22, 2024 17:06
@OwenKephart OwenKephart force-pushed the 10-17-add-automation-condition-to-observable-source-asset branch from 93d0b9b to 22f6c55 Compare October 22, 2024 18:02
@OwenKephart OwenKephart force-pushed the 10-14-_wip_update_evaluation_id_logic branch from dbe2739 to 6179c0e Compare October 22, 2024 18:02
@OwenKephart OwenKephart force-pushed the 10-17-add-automation-condition-to-observable-source-asset branch from 22f6c55 to 0d80191 Compare October 22, 2024 18:39
@OwenKephart OwenKephart force-pushed the 10-14-_wip_update_evaluation_id_logic branch from 6179c0e to c044439 Compare October 22, 2024 18:39
Copy link
Contributor Author

OwenKephart commented Oct 22, 2024

Merge activity

  • Oct 22, 4:25 PM EDT: A user started a stack merge that includes this pull request via Graphite.
  • Oct 22, 4:50 PM EDT: Graphite rebased this pull request as part of a merge.
  • Oct 22, 4:51 PM EDT: A user merged this pull request with Graphite.

@OwenKephart OwenKephart changed the base branch from 10-17-add-automation-condition-to-observable-source-asset to graphite-base/25269 October 22, 2024 20:45
@OwenKephart OwenKephart changed the base branch from graphite-base/25269 to master October 22, 2024 20:47
@OwenKephart OwenKephart force-pushed the 10-14-_wip_update_evaluation_id_logic branch from c044439 to 4661687 Compare October 22, 2024 20:49
@OwenKephart OwenKephart merged commit c3e96ea into master Oct 22, 2024
1 check was pending
@OwenKephart OwenKephart deleted the 10-14-_wip_update_evaluation_id_logic branch October 22, 2024 20:51
Grzyblon pushed a commit to Grzyblon/dagster that referenced this pull request Oct 26, 2024
…-io#25269)

## Summary & Motivation

When running in user-code mode, evaluation ids are always based off of the tick id. This prevents us from having to deserialize the AssetDaemonCursor server side, and just in general is an easier way of producing monotonically increasing integers across multiple values.

In general, the tick id is guaranteed to be strictly larger than the AssetDaemonCursor value, as the daemon cursor (unless manually edited) cannot increase without a new tick being created. This means that it is safe to switch from daemon-mode to user-mode, but if you switch from user-mode back to daemon-mode, you could end up with an evaluation id that was much smaller, with the end result being that new evaluation records you produce would have a lower evaluation_id than older ones, messing up the history.

This change makes it so that the daemon-mode id will stay in sync with the tick id, avoiding this issue.

## How I Tested These Changes

Existing tests, with some small updates.

## Changelog

NOCHANGELOG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants