How to correctly handle locked and reprocessed batches?
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- aws, javascript
Research direction
Start with unlockBatch.js and reprocessBatch.js, then inspect the LambdaRedshiftBatches and LambdaRedshiftBatchLoadConfig records alongside the reported CloudWatch log. Trace how locked, reprocessed, and open batches update currentBatch, and document the expected recovery path and whether all affected S3 files reach Redshift.
Written by the indexing model from the issue text.
Description
Hi,
We are using the loader function to load JSON files (generated from an Apache Spark application running in an EMR cluster) to Redshift.
We ran into an issue where many batches became "locked". We think this was related to a problem where we had many ProvisionedThroughputExceededException on the DynamoDB tables backing the loader function. We increased the provisioning for the tables, but we are noticing that for some of our s3Prefix configurations, we are not seeing any new data loaded to Redshift. We are also seeing many of these logs in Cloudwatch:
"2017-03-16T20:00:20.166Z 2e92425c-0a83-11e7-8d55-69fee54689ef Reload of Configuration Complete after attempting to write to Locked Batch a0d645fd-5dbb-4386-b2c5-4674426851a9. Attempt 1"
(This log was for batchId a0d645fd-5dbb-4386-b2c5-4674426851a9 in particular, but we see them for many batches.)
I noticed that the batches for which we are seeing these messages were marked as "locked" in the LambdaRedshiftBatches table. I used the included unlockBatch.js script, and the reprocessBatch.js script, to attempt to "reprocess" these batches. This did not work - the batch status in LambdaRedshiftBatches became marked as "reprocessed", but we continued to see the aforementioned logs in Cloudwatch.
Next, I noticed that for the rows in LambdaRedshiftBatchLoadConfig where the s3Prefix corresponded to a locked/reprocessed batchId, the currentBatch property referred to the locked/reprocessed batchId. I queried LambdaRedshiftBatches for any open batches for that s3Prefix, then manually updated the currentBatch property in LambdaRedshiftBatchLoadConfig with the batchId of the open batch.
This seems to have resolved the issue, but I'm unsure now if I've missed loading the files in the locked/reprocessed batches into Redshift. I'm left with a number of other questions:
- What does it mean for a batch to have the status "locked" or "reprocessed"?
- How can batches get into the "locked" state?
- I noticed that there were many "open" batches for a particular s3Prefix in LambdaRedshiftBatches. Is this normal? The documentation states "There will always be one open batch, and may be multiple closed batches per S3 input prefix from LambdaRedshiftBatchLoadConfig", but does this mean only one open batch per s3Prefix?
- If it is true that there should be only one open batch per s3Prefix, how could the system get into a state where there are multiple?
- Was there a better way for me to handle my situation?
Hope you can help, and please let me know if any more info from me would be of use.
Regards,
Justin
- Dominant language
- JavaScript
- Stars
- 595
- Forks
- 161
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from awslabs/aws-lambda-redshift-loader
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 32/100
awslabs/aws-lambda-redshift-loader#247 · 3 comments ·
-
Manifest missing file returned in describeBatch.jsMay be free again @IanMeyers claimed this 1389 days ago, and no pull request is open. Open
awslabs/aws-lambda-redshift-loader#244 · 4 comments · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
awslabs/aws-lambda-redshift-loader#239 · 4 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
awslabs/aws-lambda-redshift-loader#238 · 1 comment ·
All issues in awslabs/aws-lambda-redshift-loader
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
dusk-network/exu#17 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
jspreadsheet/ce#1809 ·
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 91/100
githubnext/gh-aw-workshop#4458 ·
Maintainers usually reply within 1 day
-
Add: CartoonitoOpencheck:failed feeds:add
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
iptv-org/database#37390 · 1 comment ·
Maintainers usually reply within 9 days
-
bug: directory index route root priority is overwritten when wildcard is falsePossibly taken @TalhaHunter101 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
fastify/fastify-static#617 ·