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

Default timezone regression #4658

Closed
silviucpp opened this issue Mar 11, 2019 · 8 comments
Closed

Default timezone regression #4658

silviucpp opened this issue Mar 11, 2019 · 8 comments
Assignees
Labels
bug Confirmed user-visible misbehaviour in official release comp-darwin Darwin-related builds and cross-builds comp-datetime date & time & timezone related

Comments

@silviucpp
Copy link
Contributor

silviucpp commented Mar 11, 2019

After I upgraded to last master today (from an old version from sept 2018) I see at least on OSX that even if in config.xml I have <timezone>UTC</timezone> the server is using the system timezone which is Europe/Bucharest.

This can be tested as well using SELECT timezone()

Anything changed config wise in the last time ?

Silviu

@silviucpp silviucpp added the bug Confirmed user-visible misbehaviour in official release label Mar 11, 2019
@silviucpp
Copy link
Contributor Author

I found the problem:

When setting the value from config we have:

/// This must be done before any usage of DateLUT. In particular, before any logging.
    if (config().has("timezone"))
    {
        if (0 != setenv("TZ", config().getString("timezone").data(), 1))
            throw Poco::Exception("Cannot setenv TZ variable");

        tzset();
    }

As comment says this should execute before any DateLUT is created. But adding a fprintf in this place and in DateLut config indicates that DateLut is created first and then this code is executed.

Didn't found yet where is created. I'll dig more.

@silviucpp
Copy link
Contributor Author

Seems the above condition get broken on the ParquetBlockInputStream.cpp line 262 where creating this global variable

const std::unordered_map<arrow::Type::type, std::shared_ptr<IDataType>> arrow_type_to_internal_type = {
    ...
    {arrow::Type::DATE64, std::make_shared<DataTypeDateTime>()},
    {arrow::Type::TIMESTAMP, std::make_shared<DataTypeDateTime>()},
    //{arrow::Type::TIME32, std::make_shared<DataTypeDateTime>()},
   ...
};

Makes DateLUT to be initialized before the above statement is executed.

@Slind14
Copy link

Slind14 commented Mar 20, 2019

We ran into the same issue which broke nearly everything for use because it all depends on the timezone. It would be great if this could be resolved and rolled out very soon.

@silviucpp
Copy link
Contributor Author

Building with -DENABLE_PARQUET=0 can be used as workaround

@Slind14
Copy link

Slind14 commented Mar 20, 2019

Thank you @proller
Any chance for a hotfix release?

@dstruck
Copy link

dstruck commented Apr 1, 2019

Latest release still has the issue.

$ clickhouse-client 
ClickHouse client version 19.4.2.7.
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 19.4.2 revision 54416.

xxx :) SELECT timezone()

SELECT timezone()

┌─timezone()────────┐
│ Europe/Berlin     │
└───────────────────┘

As a temporary fix you can set a specific timezone in the environment. Add the following lines with systemctl edit clickhouse-server.service and restart the server:

[Service]
Environment=TZ=UTC

@ekbfh
Copy link

ekbfh commented Apr 24, 2019

Have this problem too on 19.4.3 revision 54416

@ekbfh
Copy link

ekbfh commented May 16, 2019

@filimonov filimonov added the comp-datetime date & time & timezone related label Aug 2, 2019
@filimonov filimonov added the comp-darwin Darwin-related builds and cross-builds label Dec 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed user-visible misbehaviour in official release comp-darwin Darwin-related builds and cross-builds comp-datetime date & time & timezone related
Projects
None yet
Development

No branches or pull requests

6 participants