Skip to content

fix: preserve queued wiki housekeeping tasks#1768

Open
cctv549681 wants to merge 5 commits into
Tencent:mainfrom
cctv549681:fix/wiki-pending-housekeeping-community
Open

fix: preserve queued wiki housekeeping tasks#1768
cctv549681 wants to merge 5 commits into
Tencent:mainfrom
cctv549681:fix/wiki-pending-housekeeping-community

Conversation

@cctv549681

@cctv549681 cctv549681 commented Jun 23, 2026

Copy link
Copy Markdown

Description

Fixes a false-positive housekeeping failure for wiki knowledge rows that are still waiting in the task queue.

This PR updates housekeeping to distinguish genuinely orphaned processing/finalizing knowledge rows from rows that are still backed by queued or active tasks. It also adds a precise pending-op lookup for wiki ingest tasks, so a finalizing wiki knowledge item is not marked failed while its durable pending operation still exists.

Changes include:

  • Add read-only task queue inspection before housekeeping marks stale knowledge as failed
  • Check task_pending_ops by exact wiki ingest dedup key for finalizing wiki rows
  • Add a dedup index migration for task_pending_ops
  • Add regression tests for queued task, wiki pending-op, and probe-error cases

Type of Change

  • 🐛 Bug fix

Related Issue

Fixes #

Testing

go test ./internal/application/service -run 'TestHousekeeping'
go test ./internal/application/repository -run 'TestTaskPendingOps'

Checklist

  • make fmt && make lint && make test pass locally
  • Self-reviewed the code
  • Added/updated tests covering the change
  • Updated related documentation (README, docs/, Swagger annotations, etc.)
  • Breaking changes are clearly called out in the description above

Screenshots / Recordings

before:

image img_v3_0212p_fd1093bd-e473-441d-a281-f95d474ca57g

after:
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant