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

Nanos in timestamp INT96 can be negative #486

Merged
merged 2 commits into from
Mar 26, 2024

Conversation

liujiayi771
Copy link

If the time point represented by the timestamp is before 1970, the nanos in the INT96 representation of the timestamp may be negative.

@@ -101,7 +101,7 @@ struct Timestamp {

constexpr Timestamp() : seconds_(0), nanos_(0) {}

Timestamp(int64_t seconds, uint64_t nanos)
Timestamp(int64_t seconds, int64_t nanos)
: seconds_(seconds), nanos_(nanos) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nanos_ is still uint64_t, do we need to change it?

@rui-mo
Copy link
Collaborator

rui-mo commented Mar 26, 2024

Included this change in facebookincubator#4680, and we could remove this commit from this repo after repicking facebookincubator#4680. cc: @marin-ma

@rui-mo rui-mo merged commit 5e62031 into oap-project:2024_03_26 Mar 26, 2024
5 of 11 checks passed
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.

2 participants