Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server: TableMetadataUpdateJob should not return error when failing to trigger the job due to it being unclaimed #137777

Closed
xinhaoz opened this issue Dec 19, 2024 · 1 comment · Fixed by #137993
Assignees
Labels
branch-release-24.3 Used to mark GA and release blockers, technical advisories, and bugs for 24.3 C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-observability

Comments

@xinhaoz
Copy link
Member

xinhaoz commented Dec 19, 2024

On node / pod startup the table metadata job can take a little bit to get claimed. Failing to trigger the job before it's claimed is an expected state and the api shouldn't return an error since the client will just retry the request at a later date.

Jira issue: CRDB-45742

@xinhaoz xinhaoz added the C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. label Dec 19, 2024
@xinhaoz xinhaoz self-assigned this Dec 19, 2024
Copy link

blathers-crl bot commented Dec 19, 2024

Hi @xinhaoz, please add branch-* labels to identify which branch(es) this C-bug affects.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@xinhaoz xinhaoz added the branch-release-24.3 Used to mark GA and release blockers, technical advisories, and bugs for 24.3 label Dec 19, 2024
@exalate-issue-sync exalate-issue-sync bot removed the branch-release-24.3 Used to mark GA and release blockers, technical advisories, and bugs for 24.3 label Dec 19, 2024
xinhaoz added a commit to xinhaoz/cockroach that referenced this issue Dec 26, 2024
Previously POST on `/api/v2/table_metadata/updatejob` would
return error if the table metadata update job was unclaimed,
which is an expected failure. In those cases we should return
200 with `JobTriggered: false` and a message describing the
failure.

The gPRC handler to trigger the job was already returning
`status.Unavailable` if the job was unclaimed. The http api
handler has now been adjusted to treat this error code as an
expected failure case and will return a 200 response with
the message `Job is unclaimed` as the reason for failing to
trigger the job.

Fixes: cockroachdb#137777

Release note (bug fix): On the v2 databases page, users
should no longer see console errors when visitingn the
db page directly after node / sql pod startup.
@exalate-issue-sync exalate-issue-sync bot added branch-release-24.3 Used to mark GA and release blockers, technical advisories, and bugs for 24.3 T-observability labels Dec 26, 2024
craig bot pushed a commit that referenced this issue Jan 3, 2025
137993: server: fix errors returned from TriggerMetadataUpdateJob r=xinhaoz a=xinhaoz

Previously POST on `/api/v2/table_metadata/updatejob` would return error if the table metadata update job was unclaimed, which is an expected failure. In those cases we should return 200 with `JobTriggered: false` and a message describing the failure.

The gPRC handler to trigger the job was already returning `status.Unavailable` if the job was unclaimed. The http api handler has now been adjusted to treat this error code as an expected failure case and will return a 200 response with the message `Job is unclaimed` as the reason for failing to trigger the job.

Fixes: #137777

Release note (bug fix): On the v2 databases page, users should no longer see console errors when visitingn the db page directly after node / sql pod startup.

Co-authored-by: Xin Hao Zhang <[email protected]>
@craig craig bot closed this as completed in 21c3bde Jan 3, 2025
xinhaoz added a commit to xinhaoz/cockroach that referenced this issue Jan 7, 2025
Previously POST on `/api/v2/table_metadata/updatejob` would
return error if the table metadata update job was unclaimed,
which is an expected failure. In those cases we should return
200 with `JobTriggered: false` and a message describing the
failure.

The gPRC handler to trigger the job was already returning
`status.Unavailable` if the job was unclaimed. The http api
handler has now been adjusted to treat this error code as an
expected failure case and will return a 200 response with
the message `Job is unclaimed` as the reason for failing to
trigger the job.

Fixes: cockroachdb#137777

Release note (bug fix): On the v2 databases page, users
should no longer see console errors when visitingn the
db page directly after node / sql pod startup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch-release-24.3 Used to mark GA and release blockers, technical advisories, and bugs for 24.3 C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-observability
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant