Compaction task retries a job whose input files no longer exist
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- backend, data-engineering
Research direction
Start in CompactionTask.commitCompaction and CompactionTask.prepareCompactionMessage, where FileReferenceNotFoundException is handled differently. Then read FileReferenceStoreQueries.isAssigned and the existing tests CompactionTaskCommitTest and CompactionTaskAssignFilesTest. Done when a re-delivered committed job is deleted without rerunning or counting as a failure, and the output file is not rewritten. The ECSCompactionTaskRunnerLocalStackIT test should also pass.
Written by the indexing model from the issue text.
Description
Background / Description
A compaction job message can be delivered to a compaction task again after the job has already been committed to the state store. For example:
- The task crashes after committing the job, and before deleting the message from the job queue.
- With asynchronous commit, the task crashes after sending the commit request, and before deleting the message.
- The keep alive thread in
SqsCompactionQueueHandlerfails to extend the message visibility while the job is running, so another task picks up the message.
Once a job has been committed, its input files have no references. The garbage collector deletes them from S3 after the GC delay (sleeper.table.gc.delay.minutes, 15 minutes by default).
If the job is delivered again after its input files have been deleted, the compaction fails reading them from S3. CompactionTask.processCompactionMessage handles this as a generic failure, so the message is returned to the queue and a consecutive failure is counted. This happens with both synchronous and asynchronous commit.
The job can never succeed, but it is retried on every delivery until the message reaches the dead letter queue. Each attempt counts as a consecutive failure, which can terminate a healthy task.
Steps to reproduce
In CompactionTaskCommitTest, with either value of COMPACTION_JOB_COMMIT_ASYNC:
- Run a job and let it commit.
- Delete the input files, as if the garbage collector had run.
- Send the same job to the queue again and run the task.
Result: the job fails reading its input files, the message is returned to the queue, and a consecutive failure is counted.
Expected behaviour
If a compaction fails because an input file does not exist, the task deletes the message, records the failure in the job tracker, and does not count it as a consecutive failure.
Technical Notes / Implementation Details
- In both the Java and DataFusion compaction runners, detect when a compaction fails because an input file does not exist, and throw a specific exception type for it. This keeps
CompactionTaskindependent of S3 and Hadoop exception types. - In
CompactionTask.processCompactionMessage, catch that exception, delete the message from the queue and record the job as failed, without incrementing the consecutive failures.
To be agreed: whether a missing input file should ever be treated as a fault that needs investigation, e.g. a symptom of a garbage collector bug. The proposal here is that the failure recorded in the job tracker is enough, and the message does not need to go to the dead letter queue.
Out of scope
If the job is delivered again before its input files are deleted, the compaction reruns and overwrites its output file. The task's handling of the resulting commit failure is covered by #8616, and safe reads during an overwrite by #8617 .
- Dominant language
- Java
- Stars
- 107
- Forks
- 29
- Avg merge
- 1d 33m
- Merged PRs (30d)
- 115
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- 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 gchq/sleeper
-
enhancement scripts
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
EMR executor market type is not validated and any value other than ON_DEMAND is treated as SPOTOpenbug bulk-import-module
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug needs-refinement under-discussion
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
gchq/sleeper#8632 · 1 comment ·
Maintainers usually reply within 1 day
-
bug needs-refinement under-discussion
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Transaction log follower logs an error for every transaction deleted from the files logPossibly taken @ca61688 claimed this 1 day ago. Openbug size:small
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
gchq/sleeper#8624 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
Similar issues
-
Type: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
MovingBlocks/Terasology#5415 ·
-
type: possible bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
面渣逆袭Spring事务传播机制勘误Open
Difficulty 1/5 Under an hour Newbie friendliness 80/100
itwanger/toBeBetterJavaer#218 ·
-
Markdown and Astro language servers do not start when the project path contains a non-ASCII character or a spacePossibly taken @RoiSoleil claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
eclipse-wildwebdeveloper/wildwebdeveloper#2277 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
openrewrite/rewrite-spring#1286 ·
Maintainers usually reply within 1 day