storacha-network / w3infra

🏗️ Infra for the w3up UCAN protocol implementation
Other
15 stars 5 forks source link

fix: make filecoin accept receipt cron run more times #350

Closed vasco-santos closed 4 months ago

vasco-santos commented 4 months ago

We saw some backlog growing while issuing filecoin/accept receipts. This is due to not have pagination in the query that goes through submmited pieces pending a receipt.

Looking at the CRON execution duration, we can conclude for the last 5 days that average duration goes under 300k ms (5min). Which means we were having CRON alive 5 min and then 5 minutes sleeping. While we do not implement pagination on the query this seems a quick win.

Also note that if the CRON function ends up sometimes timing out, it is not really problematic. Looking at the code we run, we just go through table and, for each entry go through receipt chain to see if we can update the status (which makes a new lambda run to issue receipt). Therefore, if we timeout and restart the job, we will keep going where we were

image
seed-deploy[bot] commented 4 months ago
View stack outputs - **pr350-w3infra-BillingDbStack** Name | Value -- | -- customerTableName | pr350-w3infra-customer spaceDiffTableName | pr350-w3infra-space-diff spaceSnapshotTableName | pr350-w3infra-space-snapshot usageTable | pr350-w3infra-usage - **pr350-w3infra-BillingStack** Name | Value -- | -- ApiEndpoint | https://bxde67vtrl.execute-api.us-east-2.amazonaws.com billingCronHandlerURL | https://uiij4edgr4fygs2rpqpid2oyv40bpxdh.lambda-url.us-east-2.on.aws/ CustomDomain | https://pr350.billing.web3.storage - **pr350-w3infra-CarparkStack** Name | Value -- | -- BucketName | carpark-pr350-0 Region | us-east-2 - **pr350-w3infra-RoundaboutStack** Name | Value -- | -- ApiEndpoint | https://oavu7yjfvf.execute-api.us-east-2.amazonaws.com CustomDomain | https://pr350.roundabout.web3.storage - **pr350-w3infra-SatnavStack** Name | Value -- | -- BucketName | satnav-pr350-0 Region | us-east-2 - **pr350-w3infra-UploadApiStack** Name | Value -- | -- ApiEndpoint | https://ebjbyod34k.execute-api.us-east-2.amazonaws.com CustomDomain | https://pr350.up.web3.storage - **pr350-w3infra-BusStack** - **pr350-w3infra-FilecoinStack** - **pr350-w3infra-ReplicatorStack** - **pr350-w3infra-UcanFirehoseStack** - **pr350-w3infra-UcanInvocationStack** - **pr350-w3infra-UploadDbStack**
vasco-santos commented 4 months ago

merging this to help out to go through the backlog existing at the moment