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

Add OrderBy field for OperationFilter #969

Merged

Conversation

adam-singer
Copy link
Contributor

@adam-singer adam-singer commented Jun 4, 2024

Description

Adjustment to operation state manager api to include a order by field.

Fixes # #983

Type of change

  • Refactor (non-breaking change which no functionality added)

How Has This Been Tested?

Please also list any relevant details for your test configuration

Checklist

  • Tests added/amended
  • bazel test //... passes locally
  • PR is contained in a single commit, using git amend see some docs

This change is Reviewable

Copy link
Member

@allada allada left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: 1 of 1 LGTMs obtained, and 2 discussions need to be resolved


nativelink-scheduler/src/operation_state_manager.rs line 91 at r1 (raw file):

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct OrderBy {
    pub fields: Vec<OperationFields>,

nit: Public structs need all fields documented.


nativelink-scheduler/src/operation_state_manager.rs line 101 at r1 (raw file):

    /// Add a new action to the queue or joins an existing action.
    async fn add_action(
        &mut self,

nit: We don't want to require mut. Lets use internal locking for places that need exclusive access.

Exclusiveness implies it cannot be in an Arc or have any other owners. I'd rather abstract this away behind the interface, like stores do.

Copy link
Contributor

@zbirenbaum zbirenbaum left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 of 1 LGTMs obtained, and 2 discussions need to be resolved


nativelink-scheduler/src/operation_state_manager.rs line 91 at r1 (raw file):

Previously, allada (Nathan (Blaise) Bruer) wrote…

nit: Public structs need all fields documented.

I'm not sure how we would choose to sort by descending or ascending here, and I think that something like last_worker_update might be relevant as the timestamp in question rather than just insert timestamp.

If we have a specific use case in mind I don't mind this as is, just not sure the use case for sorting by timestamp.

Copy link
Contributor Author

@adam-singer adam-singer left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 of 1 LGTMs obtained, and 2 discussions need to be resolved


nativelink-scheduler/src/operation_state_manager.rs line 91 at r1 (raw file):

Previously, zbirenbaum (Zach Birenbaum) wrote…

I'm not sure how we would choose to sort by descending or ascending here, and I think that something like last_worker_update might be relevant as the timestamp in question rather than just insert timestamp.

If we have a specific use case in mind I don't mind this as is, just not sure the use case for sorting by timestamp.

I imagine one reason could be latent actions based on timestamps that have no laster worker update?


nativelink-scheduler/src/operation_state_manager.rs line 101 at r1 (raw file):

Previously, allada (Nathan (Blaise) Bruer) wrote…

nit: We don't want to require mut. Lets use internal locking for places that need exclusive access.

Exclusiveness implies it cannot be in an Arc or have any other owners. I'd rather abstract this away behind the interface, like stores do.

sg

Adjustment to operation state manager api to include a order by field.
@adam-singer adam-singer force-pushed the adams/add-order-by-field branch from f5b983d to f881782 Compare June 7, 2024 05:43
Copy link
Contributor Author

@adam-singer adam-singer left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 of 1 LGTMs obtained, and pending CI: Analyze (javascript-typescript), Analyze (python), Bazel Dev / ubuntu-22.04, Cargo Dev / macos-13, Cargo Dev / ubuntu-22.04, Installation / macos-13, Installation / macos-14, Installation / ubuntu-22.04, Local / ubuntu-22.04, Publish image, Publish nativelink-worker-lre-cc, Remote / large-ubuntu-22.04, asan / ubuntu-22.04, docker-compose-compiles-nativelink (20.04), docker-compose-compiles-nativelink (22.04), integration-tests (20.04), integration-tests (22.04), macos-13, pre-commit-checks, ubuntu-20.04 / stable, ubuntu-22.04, ubuntu-22.04 / stable, vale, windows-2022 / stable


nativelink-scheduler/src/operation_state_manager.rs line 91 at r1 (raw file):

Previously, adam-singer (Adam Singer) wrote…

I imagine one reason could be latent actions based on timestamps that have no laster worker update?

Done.


nativelink-scheduler/src/operation_state_manager.rs line 101 at r1 (raw file):

Previously, adam-singer (Adam Singer) wrote…

sg

Done.

@adam-singer adam-singer merged commit a911af4 into TraceMachina:main Jun 7, 2024
28 checks passed
@adam-singer adam-singer deleted the adams/add-order-by-field branch June 7, 2024 13:47
Copy link
Member

@allada allada left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! 1 of 1 LGTMs obtained

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.

3 participants