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

treewide: Favor native async traits #1234

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ethan-readyset
Copy link
Contributor

@ethan-readyset ethan-readyset commented Apr 23, 2024

Native async traits were stabilized as of Rust 1.75, so we no longer need
the async_trait crate in many situations. This commit replaces the 3rd
party crate with the native version everywhere we can. The areas of the
code that still require the 3rd party crate include:

  • Any trait that is used as a trait object (this is not supported
    natively by Rust yet)
  • Certain traits that returned lifetime errors when attempting to remove
    the #[async_trait] macro (these errors included a message that said
    the error was a known limitation and would be removed in the future)
  • The trait in proptest-stateful, whose interface I didn't want to change
    without further discussion, since it's a publicly-available trait

@readysetbot readysetbot force-pushed the I95db5ded6d4ac1b530751d2a873240c5d023a5b4 branch from eb562f7 to 06455e0 Compare April 23, 2024 22:18
@readysetbot readysetbot force-pushed the I5c761c075966e4fcebbb6d4955608107cf871b7c branch 2 times, most recently from 29573d6 to 4913098 Compare April 23, 2024 22:42
@readysetbot readysetbot force-pushed the I95db5ded6d4ac1b530751d2a873240c5d023a5b4 branch from 06455e0 to cb2c018 Compare April 23, 2024 23:01
@readysetbot readysetbot force-pushed the I5c761c075966e4fcebbb6d4955608107cf871b7c branch from 4913098 to d0fd81e Compare April 23, 2024 23:01
@readysetbot readysetbot force-pushed the I95db5ded6d4ac1b530751d2a873240c5d023a5b4 branch from cb2c018 to 181ab75 Compare April 23, 2024 23:11
@readysetbot readysetbot force-pushed the I5c761c075966e4fcebbb6d4955608107cf871b7c branch from d0fd81e to 9fe9dfd Compare April 23, 2024 23:11
@readysetbot readysetbot force-pushed the I95db5ded6d4ac1b530751d2a873240c5d023a5b4 branch from 181ab75 to cc81f71 Compare April 23, 2024 23:14
@readysetbot readysetbot force-pushed the I5c761c075966e4fcebbb6d4955608107cf871b7c branch from 9fe9dfd to cef8225 Compare April 23, 2024 23:15
@readysetbot readysetbot force-pushed the I95db5ded6d4ac1b530751d2a873240c5d023a5b4 branch from cc81f71 to cdf31d4 Compare April 24, 2024 17:30
@readysetbot readysetbot force-pushed the I5c761c075966e4fcebbb6d4955608107cf871b7c branch from cef8225 to bf82a1d Compare April 24, 2024 17:31
@ethan-readyset ethan-readyset changed the base branch from I95db5ded6d4ac1b530751d2a873240c5d023a5b4 to main April 24, 2024 19:16
@readysetbot readysetbot force-pushed the I5c761c075966e4fcebbb6d4955608107cf871b7c branch 3 times, most recently from 32292d2 to 5ae3553 Compare April 25, 2024 20:44
@ethan-readyset ethan-readyset changed the base branch from main to I73174d2aa27cb077941eab13ab1b613a6e6a4a07 April 25, 2024 20:44
@readysetbot readysetbot force-pushed the I73174d2aa27cb077941eab13ab1b613a6e6a4a07 branch from fda13a7 to 35c5d1e Compare April 26, 2024 15:15
@readysetbot readysetbot force-pushed the I5c761c075966e4fcebbb6d4955608107cf871b7c branch from 5ae3553 to 86a162b Compare April 26, 2024 15:15
@readysetbot readysetbot force-pushed the I73174d2aa27cb077941eab13ab1b613a6e6a4a07 branch from 35c5d1e to adbf3d1 Compare May 6, 2024 19:07
@readysetbot readysetbot force-pushed the I5c761c075966e4fcebbb6d4955608107cf871b7c branch from 86a162b to 0255d96 Compare May 6, 2024 19:07
@readysetbot readysetbot force-pushed the I73174d2aa27cb077941eab13ab1b613a6e6a4a07 branch from adbf3d1 to 375847d Compare May 6, 2024 19:19
@readysetbot readysetbot force-pushed the I5c761c075966e4fcebbb6d4955608107cf871b7c branch 2 times, most recently from 80c0c9b to 56d06d3 Compare May 6, 2024 19:43
@readysetbot readysetbot force-pushed the I73174d2aa27cb077941eab13ab1b613a6e6a4a07 branch from 375847d to 41fe772 Compare May 7, 2024 15:26
@readysetbot readysetbot force-pushed the I5c761c075966e4fcebbb6d4955608107cf871b7c branch from 56d06d3 to c2197d8 Compare May 7, 2024 15:26
@readysetbot readysetbot force-pushed the I73174d2aa27cb077941eab13ab1b613a6e6a4a07 branch from 41fe772 to 41c9cd7 Compare May 13, 2024 16:23
@readysetbot readysetbot force-pushed the I5c761c075966e4fcebbb6d4955608107cf871b7c branch from c2197d8 to 5dc0b8b Compare May 13, 2024 16:23
@readysetbot readysetbot force-pushed the I73174d2aa27cb077941eab13ab1b613a6e6a4a07 branch from 41c9cd7 to ce58494 Compare May 21, 2024 20:05
@readysetbot readysetbot force-pushed the I5c761c075966e4fcebbb6d4955608107cf871b7c branch from 5dc0b8b to b362aa7 Compare May 21, 2024 20:05
@readysetbot readysetbot force-pushed the I73174d2aa27cb077941eab13ab1b613a6e6a4a07 branch from ce58494 to f4d1821 Compare May 21, 2024 20:08
@readysetbot readysetbot force-pushed the I5c761c075966e4fcebbb6d4955608107cf871b7c branch from b362aa7 to bf43194 Compare May 21, 2024 20:08
Previously, the views synchronizer only checked the server for views for
queries that were in the "pending" state. This meant that if the
migration handler set a query's state to "dry run succeeded" before the
views synchronizer had a chance to check the server for a view, the query
would be stuck in the "dry run succeeded" state forever, even if a view
for the query did indeed exist already.

This commit fixes the issue by having the views synchronizer check the
server for views for queries in *either* the "pending" or "dry run
succeeded" states. In order to prevent the views synchronizer from
rechecking every query with status "dry run succeeded" over and over
again, a "cache" has been added to the views synchronizer to keep track
of which queries have already been checked.

While working on this, I also noticed that it was possible for the
following sequence of events to occur:

- Migration handler sees that a query is pending and kicks off a dry run
  migration
- Views synchronizer finds a view on the server for the same query and
  sets the status to "successful"
- Migration handler finishes the dry run migration for the query and
  overwrites the status as "dry run succeeded"

This could lead to a situation where a query that was previously
(correctly) labeled as "successful" is moved back to the "dry run
succeeded" state. To fix the issue, this commit updates the migration
handler to only write the "dry run succeeded" status if the query's
status is still "pending" after the dry run is completed.

Release-Note-Core: Fixed a bug where queries that already had caches
  were sometimes stuck in the `SHOW PROXIED QUERIES` list
Change-Id: Ie5faa100158fc80c906d8ad5cb897d8a02a07be9
Reviewed-on: https://gerrit.readyset.name/c/readyset/+/7442
Tested-by: Buildkite CI
Reviewed-by: Jason Brown <jason.b@readyset.io>
This reverts commit bde05974330a69526f06f1fbcafab925064cd659.

Change-Id: I56b71ed96e508ac617579ca1d0e181a1387671f1
Reviewed-on: https://gerrit.readyset.name/c/readyset/+/7396
Tested-by: Buildkite CI
Reviewed-by: Jason Brown <jason.b@readyset.io>
This reverts commit 337df377be353ebd4f0fa548f1301997ba7d3e28.

Change-Id: I73174d2aa27cb077941eab13ab1b613a6e6a4a07
Reviewed-on: https://gerrit.readyset.name/c/readyset/+/7397
Tested-by: Buildkite CI
Reviewed-by: Jason Brown <jason.b@readyset.io>
Native async traits were stabilized as of Rust 1.75, so we no longer need
the async_trait crate in many situations. This commit replaces the 3rd
party crate with the native version everywhere we can. The areas of the
code that still require the 3rd party crate include:

- Any trait that is used as a trait object (this is not supported
  natively by Rust yet)
- Certain traits that returned lifetime errors when attempting to remove
  the `#[async_trait]` macro (these errors included a message that said
  the error was a known limitation and would be removed in the future)
- The trait in proptest-stateful, whose interface I didn't want to change
  without further discussion, since it's a publicly-available trait

Change-Id: I5c761c075966e4fcebbb6d4955608107cf871b7c
@readysetbot readysetbot force-pushed the I73174d2aa27cb077941eab13ab1b613a6e6a4a07 branch from f4d1821 to 0165dee Compare May 22, 2024 16:01
@ethan-readyset ethan-readyset changed the base branch from I73174d2aa27cb077941eab13ab1b613a6e6a4a07 to main May 22, 2024 16:02
@readysetbot readysetbot force-pushed the I5c761c075966e4fcebbb6d4955608107cf871b7c branch from bf43194 to 5f1c8ee Compare May 22, 2024 16:02
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.

None yet

1 participant