php - Date insertion in Cassandra DB: non-trivial 1h shift issue (follow-up) -
this follow-up of other original post.
environment:
cassandra running on opensuse (over java virtual machine).
server set timezone "europe/zurich".
the tests include server only. no other servers involved.
test:
"begin batch using consistency 1 insert tsmeasures(id,'2015-01-01 00:00:00','2015-06-01 00:00:00') values ('2812621',1,2) apply batch" results observed php (on same cassandra sever):
"select '2014-06-01'..'2015-12-01' tsmeasures id in(2812621)" unpacked_value=1420066800, str_time='2015-01-01 00:00:00' <= ok unpacked_value=1433113200, str_time='2015-06-01 01:00:00' <= not ok ! thus dates interpreted gmt+1.
solution:
in "cassandra_env.sh", add option -duser.timezone when running java:
jvm_opts="$jvm_opts -duser.timezone=europe/zurich" repeating test after fix:
"begin batch using consistency 1 insert tsmeasures(id,'2015-01-01 00:00:00','2015-06-01 00:00:00') values ('2812621',1,2) apply batch" new results observed php after fix (on same cassandra sever):
"select '2014-06-01'..'2015-12-01' tsmeasures id in(2812621)" unpacked_value=1420066800, str_time='2015-01-01 00:00:00' <= ok unpacked_value=1433113200, str_time='2015-06-01 00:00:00' <= ok dates interpreted as:
- central european winter time = gmt+1
- central european summer time = gmt+2
Comments
Post a Comment