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

Remove wildcard searching in redis scheduler #1408

Merged

Conversation

allada
Copy link
Member

@allada allada commented Oct 11, 2024

Redis does not use a b-tree under the hood, instead it aggregates the
key space, then does a union on all documents in the database. Thus,
redis has a limit on how many items are unioned (MAXEXPANSIONS); by
default redis has this set to 200. This limitation causes issues if
there ever becomes more than 200 scheduled tasks, so we get around this
by making the sort and filter index separate. Now we search explicitly
for exact match state, then sort on a different key.


This change is Reviewable

Copy link
Member Author

@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.

+@adam-singer

Reviewable status: 0 of 1 LGTMs obtained, and 0 of 10 files reviewed, and pending CI: Analyze (javascript-typescript), Analyze (python), Bazel Dev / macos-13, Bazel Dev / macos-14, Bazel Dev / ubuntu-24.04, Cargo Dev / macos-13, Cargo Dev / ubuntu-22.04, Coverage, Installation / macos-13, Installation / macos-14, Installation / ubuntu-22.04, Local / ubuntu-22.04, NativeLink.com Cloud / Remote Cache / macos-14, NativeLink.com Cloud / Remote Cache / ubuntu-24.04, Publish image, Publish nativelink-worker-init, Publish nativelink-worker-lre-cc, Remote / large-ubuntu-22.04, Web Platform Deployment / macos-14, Web Platform Deployment / ubuntu-24.04, asan / ubuntu-22.04, docker-compose-compiles-nativelink (22.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 (waiting on @adam-singer)

Copy link
Contributor

@SchahinRohani SchahinRohani 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 9 of 9 files at r2, all commit messages.
Reviewable status: 0 of 1 LGTMs obtained, and all files reviewed, and pending CI: Bazel Dev / macos-13, Bazel Dev / macos-14, Bazel Dev / ubuntu-24.04, Cargo Dev / macos-13, Cargo Dev / ubuntu-22.04, Coverage, Installation / macos-13, Installation / macos-14, Installation / ubuntu-22.04, NativeLink.com Cloud / Remote Cache / macos-14, NativeLink.com Cloud / Remote Cache / ubuntu-24.04, Publish image, Publish nativelink-worker-init, Publish nativelink-worker-lre-cc, Remote / large-ubuntu-22.04, asan / ubuntu-22.04, docker-compose-compiles-nativelink (22.04), macos-13, ubuntu-20.04 / stable, ubuntu-22.04, ubuntu-22.04 / stable, windows-2022 / stable (waiting on @adam-singer)

Redis does not use a b-tree under the hood, instead it aggregates the
key space, then does a union on all documents in the database. Thus,
redis has a limit on how many items are unioned (MAXEXPANSIONS); by
default redis has this set to 200. This limitation causes issues if
there ever becomes more than 200 scheduled tasks, so we get around this
by making the sort and filter index separate. Now we search explicitly
for exact match state, then sort on a different key.
@allada allada force-pushed the redis-scheduler-remove-wild-card-search branch from 7609aec to 456e054 Compare October 22, 2024 19:00
Copy link
Member Author

@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.

Reviewed 1 of 2 files at r3.
Reviewable status: 0 of 1 LGTMs obtained, and 9 of 10 files reviewed, and pending CI: pre-commit-checks (waiting on @adam-singer)

Copy link
Member Author

@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.

-@adam-singer

Reviewable status: 1 of 1 LGTMs obtained, and 9 of 10 files reviewed

Copy link
Member Author

@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.

Reviewed 1 of 2 files at r3.
Reviewable status: :shipit: complete! 1 of 1 LGTMs obtained, and all files reviewed

@allada allada merged commit 2238ef9 into TraceMachina:main Oct 22, 2024
33 checks passed
@allada allada deleted the redis-scheduler-remove-wild-card-search branch October 22, 2024 21:53
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