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: add MarshalJSON and UnmarshalJSON to UUID #25249

Merged
merged 1 commit into from May 3, 2018

Conversation

asubiotto
Copy link
Contributor

Fixes #23842

The gogoproto specification states that certain methods need to be
defined on a customtype:
https://github.com/gogo/protobuf/blob/1ef32a8b9fc3f8ec940126907cedb5998f6318e4/custom_types.md#custom-type-method-signatures

The lack of these JSON marshaling functions resulted in an error when
the kvTxnId was not null when requesting the active txn id through the
status endpoint.

Release note (bug fix): Fix a bug where the sessions endpoint on the
admin UI would return an error when there was an active transaction.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@a-robinson a-robinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Fixes cockroachdb#23842

The gogoproto specification states that certain methods need to be
defined on a customtype:
https://github.com/gogo/protobuf/blob/1ef32a8b9fc3f8ec940126907cedb5998f6318e4/custom_types.md#custom-type-method-signatures

The lack of these JSON marshaling functions resulted in an error when
the kvTxnId was not null when requesting the active txn id through the
status endpoint.

Release note (bug fix): Fix a bug where the sessions endpoint on the
admin UI would return an error when there was an active transaction.
@asubiotto
Copy link
Contributor Author

Pushed a fix to the test failures. The issue was that I was immediately casting a UUID string representation to bytes rather than delegating to json.Marshal, which adds quotes to strings. This would result in a marshaling error that would ultimately not add certain event logs that store a JSON representation of information.

@asubiotto
Copy link
Contributor Author

bors r+

craig bot pushed a commit that referenced this pull request May 3, 2018
25249: server: add MarshalJSON and UnmarshalJSON to UUID r=asubiotto a=asubiotto

Fixes #23842

The gogoproto specification states that certain methods need to be
defined on a customtype:
https://github.com/gogo/protobuf/blob/1ef32a8b9fc3f8ec940126907cedb5998f6318e4/custom_types.md#custom-type-method-signatures

The lack of these JSON marshaling functions resulted in an error when
the kvTxnId was not null when requesting the active txn id through the
status endpoint.

Release note (bug fix): Fix a bug where the sessions endpoint on the
admin UI would return an error when there was an active transaction.

Co-authored-by: Alfonso Subiotto Marqués <alfonso@cockroachlabs.com>
@craig
Copy link
Contributor

craig bot commented May 3, 2018

Build succeeded

@craig craig bot merged commit 7798f20 into cockroachdb:master May 3, 2018
@asubiotto asubiotto deleted the fix-uuid-err branch May 22, 2018 15:59
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.

server: sessions endpoints return UUID error
3 participants