-
Notifications
You must be signed in to change notification settings - Fork 16
[$250] DynamoDB Timeout #396
Comments
Challenge https://www.topcoder.com/challenges/632ec9db-e0e6-46d6-8db2-5141f72c2e08 has been created for this ticket. |
Challenge https://www.topcoder.com/challenges/632ec9db-e0e6-46d6-8db2-5141f72c2e08 has been assigned to afrisalyp. |
I'm not sure that changing to https://github.com/dynamoose/dynamoose/blob/v1.11.1/lib/Scan.js#L312 https://github.com/dynamoose/dynamoose/blob/v1.11.1/lib/Query.js#L302 But I agree that it's better to migrate to use We've planed it actually :) This is the explanation why we call the |
Abiut the error I think it's possible that the error came either from the dynamodb server or from the dynamoose library since we're using old version of dynamoose v 1. Any idea? |
@afrisalyp - How much effort would it be to update to a newer version of Dynamoose? |
Seems pretty complex https://dynamoosejs.com/other/FAQ/#how-do-i-migrate-from-v1-to-v2 Btw do we have other Topcoder services that run DynamoDB and dynamoose? |
I'll ask. |
Everything in v5 uses Dynamoose 1, but most other services that require any
sort of query have Elasticsearch in front of Dynamoose and the searching is
done against that ES index.
…On Mon, May 31, 2021 at 5:41 PM Justin Gasper ***@***.***> wrote:
I'll ask.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#396 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABJGMXH6OPKK7WU765JOJULTQP7ARANCNFSM45QHRLKQ>
.
|
I haven't looked closely at the code, but what I do believe is that the problem stems from us not using properly defined hash and range keys, and using a generic "get model" function in the code. I think if we switched to Query and use a range key defined on the project id, some of this would get a lot faster, but again, not an expert and not positive i'm using the correct vocabulary. Looking in Dynamo, it doesn't look like there's an index on the projectId on the issues table. On the challenge resource table, there's a defined range and hash key to partition the table to make the queries faster: https://github.com/topcoder-platform/resources-api/blob/develop/src/models/Resource.js#L10 It seems like there should be a hash key or range key on projectId |
@afrisalyp - Please see above. Note that we use dynamoose 2.3 in this API (which is being deprecated): https://github.com/topcoder-platform/evernym-api |
Hi, One important thing that is missed in my challenge submission is cleaning up the unused indexes. To summarize, here is the list of indexes that we use. Project
Issue
User
UserMapping
CopilotPayment
OwnerUserGroup
OwnerUserTeam
UserGroupMapping
UserTeamMapping
For the Also, we can consider removing indexes that are not listed there in the AWS console. Thanks. |
@afrisalyp - Thanks for that. Will this address the timeout / issue noted above? |
Yes. Too many indexes seem likely to cause this issue. The error message indicates that the table or one of the indexes is not in "Active" status. I have no idea why they become not "Active" suddenly. Maybe dynamodb did some optimization process. But reducing the number of indexes will decrease the chance of this issue. |
Payment task has been updated: https://www.topcoder.com/challenges/632ec9db-e0e6-46d6-8db2-5141f72c2e08 |
@afrisalyp - We're seeing timeouts now in other operations (not just git access links). See below for a log when a user tried to archive a project.
What we're thinking is that:
query
instead ofscanOne
?tcDirectId
, but do we need any other indices to speed things up?From @rootelement :
i don’t believe this is correct:
https://github.com/topcoder-platform/topcoder-x-ui/blob/develop/src/common/db-helper.js#L85
all()
?you’re trying to pull the whole table and filter it?
i know query is better than scan, but scan might need a better hash and range key based on the model you’re trying to pull from
Standards
https://platform.topcoder-dev.com/model/help/copilots-link
The text was updated successfully, but these errors were encountered: