- Newest
- Most votes
- Most comments
To terminate Redshift auto-copy jobs that are in a pending state, you can use SQL commands to manage these jobs directly within your Redshift serverless namespace.
For auto-copy jobs that are stuck in a pending state, you can use the DROP COPY JOB command to remove them completely:
DROP COPY JOB job_name;
You can also use ALTER COPY JOB to modify the job's behavior:
ALTER COPY JOB job_name SUSPEND;
Regarding your specific use case of loading files only from a specific prefix level without including nested folders, auto-copy doesn't directly support this type of selective loading or manifest files. Your approach of using IAM policies to restrict access to nested folders is creative, but as you've discovered, it can lead to pending jobs that block new incoming files from triggering jobs.
Instead of using IAM policies to restrict access, you might consider these alternatives:
-
Structure your S3 bucket differently to separate files that should be loaded from those that shouldn't.
-
Use a more specific prefix in your COPY command that exactly matches only the folders you want to monitor.
-
Consider implementing a Lambda function triggered by S3 events that can selectively initiate COPY commands only for files at the desired level.
For managing your auto-copy jobs, you can monitor them using system tables:
SELECT * FROM sys_copy_job; SELECT * FROM sys_copy_job_detail;
These tables will help you identify which jobs are in a pending state and need to be terminated or modified.
Note that for Redshift serverless, you'll need to manage these jobs primarily through SQL commands, as the web UI may not fully display all auto-copy jobs for serverless environments.
Sources
Redshift serverless: Autocopy jobs not displayed in web UI | AWS re:Post
Redshift serverless auto-copy | AWS re:Post
Relevant content
asked a year ago
asked a year ago
asked a year ago
- AWS OFFICIALUpdated a year ago
