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: fix errors returned from TriggerMetadataUpdateJob #137993

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xinhaoz
Copy link
Member

@xinhaoz xinhaoz commented 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: #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.

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.
@xinhaoz xinhaoz requested review from a team as code owners December 26, 2024 15:09
@xinhaoz xinhaoz requested review from dhartunian and removed request for a team December 26, 2024 15:09
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@xinhaoz xinhaoz requested a review from a team December 26, 2024 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants