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

feat: support retry #239

Merged
merged 2 commits into from
Dec 26, 2024
Merged

feat: support retry #239

merged 2 commits into from
Dec 26, 2024

Conversation

fuyufjh
Copy link
Contributor

@fuyufjh fuyufjh commented Dec 23, 2024

Resolves #238.

Also removed label from QueryExpect::Results because it's never used.

@xxchan xxchan requested review from BugenZhao and xxchan December 24, 2024 06:55
Copy link
Member

@xxchan xxchan left a comment

Choose a reason for hiding this comment

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

LGTM. Could you please update CHANGELOG and bump version in Cargo.toml? Then I will merge and release a new version

sqllogictest/src/parser.rs Outdated Show resolved Hide resolved
Comment on lines 897 to 901
let result = self.run_async(record.clone()).await;
if result.is_ok() {
return result;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we distinguish connection error and application error? I think it's not worth retrying if there's connection error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Considering that tests with retry should only take a very small proportion, I don't think it's necessary.

sqllogictest/src/runner.rs Show resolved Hide resolved
@@ -875,6 +877,35 @@ impl<D: AsyncDB, M: MakeConnection<Conn = D>> Runner<D, M> {
}
}

/// Run a single record with retry.
pub async fn run_async_with_retry(
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems confusing to introduce a new method specifically to make retry work. For example, run_parallel_async does not hit this path.

I suggest moving the retry logic into apply_record instead, given that it's a per-record modifier.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I feel that it's a bit confusing to do retry in sqllogictest --override, so I did it outside of apply_record.

For example, run_parallel_async does not hit this path.

How about rename run_async_with_retry to run_async to ensure all path are covered?

@fuyufjh fuyufjh force-pushed the eric/support_retry branch 2 times, most recently from 8eb4368 to 3529c2b Compare December 26, 2024 06:58
Signed-off-by: Eric Fu <fuyufjh@gmail.com>
Signed-off-by: Eric Fu <fuyufjh@gmail.com>
@xxchan xxchan requested a review from BugenZhao December 26, 2024 08:42
@xxchan xxchan merged commit d4121e8 into risinglightdb:main Dec 26, 2024
4 checks passed
@xxchan
Copy link
Member

xxchan commented Dec 26, 2024

published

@skyzh skyzh mentioned this pull request Dec 29, 2024
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.

feature request: support retry with backoff
3 participants