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

Allow to store Date in UTC #114

Merged
merged 4 commits into from
Nov 13, 2022
Merged

Conversation

msaf1980
Copy link
Collaborator

@msaf1980 msaf1980 commented Nov 12, 2022

go test -race ./...
?   	github.com/lomik/carbon-clickhouse	[no test files]
?   	github.com/lomik/carbon-clickhouse/carbon	[no test files]
?   	github.com/lomik/carbon-clickhouse/cmd/e2e-test	[no test files]
?   	github.com/lomik/carbon-clickhouse/grpc	[no test files]
--- FAIL: TestSlowTimestampToDays (0.00s)
    --- FAIL: TestSlowTimestampToDays/1668106870_2022-11-10T14:01:10-05:00,_UTC_2022-11-10T19:01:10Z_[0] (0.00s)
        date_test.go:59: TimestampDaysFormat() = 19306 (2022-11-10), want 19307 (2022-11-11)
    --- FAIL: TestSlowTimestampToDays/1668193200_2022-11-11T14:00:00-05:00,_UTC_2022-11-11T19:00:00Z_[1] (0.00s)
        date_test.go:59: TimestampDaysFormat() = 19307 (2022-11-11), want 19308 (2022-11-12)
    --- FAIL: TestSlowTimestampToDays/1668124800_2022-11-10T19:00:00-05:00,_UTC_2022-11-11T00:00:00Z_[2] (0.00s)
        date_test.go:59: TimestampDaysFormat() = 19306 (2022-11-10), want 19307 (2022-11-11)
    --- FAIL: TestSlowTimestampToDays/1668142799_2022-11-10T23:59:59-05:00,_UTC_2022-11-11T04:59:59Z_[3] (0.00s)
        date_test.go:59: TimestampDaysFormat() = 19306 (2022-11-10), want 19307 (2022-11-11)
    --- FAIL: TestSlowTimestampToDays/1650776160_2022-04-23T23:56:00-05:00,_UTC_2022-04-24T04:56:00Z_[4] (0.00s)
        date_test.go:59: TimestampDaysFormat() = 19105 (2022-04-23), want 19106 (2022-04-24)
--- FAIL: TestTimestampToDays (0.00s)

As I think, is a cause of go-graphite/graphite-clickhouse#184

This PR also provide a way to switch to UTC in future (need some changes in graphite-clickhouse and/or rebuild points/index/tags tables). See go-graphite/graphite-clickhouse#203

Also, provide fix for #115 (store in UTC)

@msaf1980 msaf1980 marked this pull request as draft November 12, 2022 12:38
@msaf1980 msaf1980 force-pushed the TimestampToDays branch 5 times, most recently from e03169b to a1d17d3 Compare November 13, 2022 06:55
@msaf1980 msaf1980 marked this pull request as ready for review November 13, 2022 13:47
@msaf1980 msaf1980 changed the title SlowTimestampToDays inconsistence Allow to store Date in UTC Nov 13, 2022
@msaf1980 msaf1980 merged commit 1a33775 into go-graphite:master Nov 13, 2022
msaf1980 added a commit to msaf1980/carbon-clickhouse that referenced this pull request Nov 30, 2022
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