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: add a cache for dynamodb schema validation #1308

Merged
merged 1 commit into from
Sep 29, 2023
Merged

Conversation

chebbyChefNEQ
Copy link
Contributor

Prior to this PR we describe dynamo db table everytime opening a dataset. This is okay when the number of calls to opening a table with dynamodb store is low. As DescribeTable has a account level limit of 2,500 RPS, we should avoid repeatedly calling the API.

This PR also fixes error formatting for aws sdk errors. AWS sdk error doesn't include the underlaying error unless asked for.

@@ -91,6 +101,23 @@ impl DynamoDBExternalManifestStore {
table_name: &str,
commiter_name: &str,
) -> Result<Arc<dyn ExternalManifestStore>> {
lazy_static::lazy_static! {
static ref SANITY_CHECK_CACHE: RwLock<HashSet<String>> = RwLock::new(HashSet::new());
Copy link
Contributor Author

@chebbyChefNEQ chebbyChefNEQ Sep 20, 2023

Choose a reason for hiding this comment

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

I could change this to a Lru Cache, but this is probably fine. It's very unlikly someone uses thousands of different dynamodb table for commit in the same process

@chebbyChefNEQ chebbyChefNEQ merged commit f25eeea into main Sep 29, 2023
15 checks passed
@chebbyChefNEQ chebbyChefNEQ deleted the rmeng/ddb-fix branch September 29, 2023 01:17
eddyxu pushed a commit that referenced this pull request Sep 29, 2023
Prior to this PR we describe dynamo db table everytime opening a
dataset. This is okay when the number of calls to opening a table with
dynamodb store is low. As `DescribeTable` has a account level limit of
2,500 RPS, we should avoid repeatedly calling the API.

This PR also fixes error formatting for aws sdk errors. AWS sdk error
doesn't include the underlaying error unless asked for.
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