Skip to content

Revert "Fix GCS native copy (#48981)" - #49194

Merged
nikitamikhaylov merged 1 commit into
ClickHouse:masterfrom
Algunenano:revert_gcs_headers
Apr 27, 2023
Merged

nikitamikhaylov merged 1 commit into
ClickHouse:masterfrom
Algunenano:revert_gcs_headers

Conversation

@Algunenano

@Algunenano Algunenano commented Apr 26, 2023 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

  • Fix reading from GCS storage with s3 compatibility API

Documentation entry for user-facing changes

Partially reverts #48981
This PR has broken s3 disks over GCS (with s3 compat API). Reverting the header changes make them work again.

cc @antonio2368

More details about the issue coming in a ticket

@robot-ch-test-poll1 robot-ch-test-poll1 added the pr-not-for-changelog This PR should not be mentioned in the changelog label Apr 26, 2023
@Algunenano

Copy link
Copy Markdown
Member Author

Related ticket: #49195

@nikitamikhaylov

Copy link
Copy Markdown
Member

We need to wait for Antonio's decision whether to revert or not. For now we can try to understand what exactly is wrong, probably these lines? https://github.com/ClickHouse/ClickHouse/pull/48981/files#diff-aaad9300ade1d534bdc2dd18a47e277eefab575cc0ecbe2b7954c1e5d7133d4dR263-R272

@Algunenano

Copy link
Copy Markdown
Member Author

@jrdi Can you give me a hand checking what's broken so we can introduce the reintroduce feature without breaking GCS storage?

@Algunenano

Copy link
Copy Markdown
Member Author

For now we can try to understand what exactly is wrong, probably these lines?

Yep. Removing those 3 lines make it work again. I'm not sure if there are GCS alternatives as done in https://github.com/ClickHouse/ClickHouse/pull/48981/files#diff-64668bf89e92ea1f2b02bb24546b18197b20b9c730965ce7df22074c9f077bbcR28-R30 or they just need to be present

@Algunenano

Copy link
Copy Markdown
Member Author

I've #ifdef'd that block for now in case we want to revert just that part of the PR and fix GCS disks for now.

@Algunenano

Copy link
Copy Markdown
Member Author

It seems that the header changes in #48981 also broke some (but not all) accesses to GCS to read files:

insert into t_fa227f675d284b80a47930c4012ff3d0 select * from s3('https://storage.googleapis.com/ch_store/XXXXXXXXXXXXXX.parquet', 'XXXXXXXXXX', 'XXXXXXXXXXXXXXX') 

With current master:

2023.04.27 08:14:22.874724 [ 52356 ] {2b0f6537-7470-4ac3-8ac7-54871af56daf} <Trace> ContextAccess (default): Access granted: CREATE TEMPORARY TABLE, S3 ON *.*
2023.04.27 08:14:22.875842 [ 52356 ] {2b0f6537-7470-4ac3-8ac7-54871af56daf} <Trace> S3Client: Provider type: GCS
2023.04.27 08:14:23.000601 [ 52633 ] {} <Trace> AsynchronousMetrics: MemoryTracking: was 908.76 MiB, peak 917.66 MiB, free memory in arenas 96.77 MiB, will set to 913.77 MiB (RSS), difference: 5.00 MiB
2023.04.27 08:14:23.000984 [ 52356 ] {2b0f6537-7470-4ac3-8ac7-54871af56daf} <Information> AWSClient: Response status: 400, Bad Request
2023.04.27 08:14:23.001044 [ 52356 ] {2b0f6537-7470-4ac3-8ac7-54871af56daf} <Information> AWSClient: AWSXmlClient: HTTP response code: 400
Resolved remote host IP address: 172.217.168.176:443
Request ID: 
Exception name: 
Error message: No response body.
9 response headers:
alt-svc : h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
cache-control : private, max-age=0
connection : close
content-length : 276
content-type : application/xml; charset=UTF-8
date : Thu, 27 Apr 2023 08:14:22 GMT
expires : Thu, 27 Apr 2023 08:14:22 GMT
server : UploadServer
x-guploader-uploadid : ADPycdu-UFlSX1l4yA8VgZe_OcnE2MDkrvyQN_TzQ83yU_KzP9f7v9B8wYCGXovjxcvxnQs9R8irdvNVyiFJYeR5-xXvPg
2023.04.27 08:14:23.001149 [ 52356 ] {2b0f6537-7470-4ac3-8ac7-54871af56daf} <Information> AWSClient: If the signature check failed. This could be because of a time skew. Attempting to adjust the signer.
2023.04.27 08:14:23.001398 [ 52356 ] {2b0f6537-7470-4ac3-8ac7-54871af56daf} <Error> executeQuery: Code: 499. DB::Exception: Failed to get object info: No response body.. HTTP response code: 400. (S3_ERROR) (version 23.4.1.1) (from 192.168.1.200:57758) (in query: INSERT INTO t_fa227f675d284b80a47930c4012ff3d0 SETTINGS max_insert_threads = 4 SELECT * FROM s3('https://storage.googleapis.com/ch_store/AAAAAAAAAAAAAAAAAAAAAAAAAAAAA.parquet', 'AAAAAAAAAAAAAAAAAAAAAAAA', '[HIDDEN]') SETTINGS max_insert_threads = 4), Stack trace (when copying this message, always include the lines below):

0. ./build/./contrib/llvm-project/libcxx/include/exception:134: Poco::Exception::Exception(String const&, int) @ 0x1b536113 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
1. ./build/./src/Common/Exception.cpp:91: DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x120953c3 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
2. DB::Exception::Exception<String const&, unsigned long>(int, FormatStringHelperImpl<std::type_identity<String const&>::type, std::type_identity<unsigned long>::type>, String const&, unsigned long&&) @ 0xdd020c7 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
3. ./build/./src/IO/S3/getObjectInfo.cpp:88: DB::S3::getObjectInfo(DB::S3::Client const&, String const&, String const&, String const&, DB::S3Settings::RequestSettings const&, bool, bool, bool) @ 0x167c5eee in /mnt/ch/ClickHouse/build_default/programs/clickhouse
4. ./build/./src/Storages/StorageS3.cpp:461: DB::StorageS3Source::KeysIterator::Impl::Impl(DB::S3::Client const&, String const&, std::vector<String, std::allocator<String>> const&, String const&, DB::S3Settings::RequestSettings const&, std::shared_ptr<DB::IAST>, DB::Block const&, std::shared_ptr<DB::Context const>, std::vector<DB::StorageS3Source::KeyWithInfo, std::allocator<DB::StorageS3Source::KeyWithInfo>>*) @ 0x183673d6 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
5. ./build/./src/Storages/StorageS3.cpp:505: DB::StorageS3Source::KeysIterator::KeysIterator(DB::S3::Client const&, String const&, std::vector<String, std::allocator<String>> const&, String const&, DB::S3Settings::RequestSettings const&, std::shared_ptr<DB::IAST>, DB::Block const&, std::shared_ptr<DB::Context const>, std::vector<DB::StorageS3Source::KeyWithInfo, std::allocator<DB::StorageS3Source::KeyWithInfo>>*) @ 0x1834d506 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
6. ./build/./contrib/llvm-project/libcxx/include/__memory/shared_ptr.h:701: DB::StorageS3::createFileIterator(DB::StorageS3::Configuration const&, bool, std::shared_ptr<DB::Context const>, std::shared_ptr<DB::IAST>, DB::Block const&, std::vector<DB::StorageS3Source::KeyWithInfo, std::allocator<DB::StorageS3Source::KeyWithInfo>>*) @ 0x183537c6 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
7. ./build/./src/Storages/StorageS3.cpp:1031: DB::StorageS3::read(std::vector<String, std::allocator<String>> const&, std::shared_ptr<DB::StorageSnapshot> const&, DB::SelectQueryInfo&, std::shared_ptr<DB::Context const>, DB::QueryProcessingStage::Enum, unsigned long, unsigned long) @ 0x18353c17 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
8. ./build/./contrib/llvm-project/libcxx/include/vector:537: DB::IStorage::read(DB::QueryPlan&, std::vector<String, std::allocator<String>> const&, std::shared_ptr<DB::StorageSnapshot> const&, DB::SelectQueryInfo&, std::shared_ptr<DB::Context const>, DB::QueryProcessingStage::Enum, unsigned long, unsigned long) @ 0x1813af48 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
9. ./build/./contrib/llvm-project/libcxx/include/__memory/shared_ptr.h:815: DB::InterpreterSelectQuery::executeFetchColumns(DB::QueryProcessingStage::Enum, DB::QueryPlan&) @ 0x17a51f11 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
10. ./build/./src/Interpreters/InterpreterSelectQuery.cpp:1427: DB::InterpreterSelectQuery::executeImpl(DB::QueryPlan&, std::optional<DB::Pipe>) @ 0x17a4b028 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
11. ./build/./contrib/llvm-project/libcxx/include/optional:260: DB::InterpreterSelectQuery::buildQueryPlan(DB::QueryPlan&) @ 0x17a4a73e in /mnt/ch/ClickHouse/build_default/programs/clickhouse
12. ./build/./src/Interpreters/InterpreterSelectWithUnionQuery.cpp:0: DB::InterpreterSelectWithUnionQuery::buildQueryPlan(DB::QueryPlan&) @ 0x17ad53b2 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
13. ./build/./contrib/llvm-project/libcxx/include/__memory/shared_ptr.h:603: DB::IInterpreterUnionOrSelectQuery::buildQueryPipeline(DB::QueryPlan&) @ 0x17a280af in /mnt/ch/ClickHouse/build_default/programs/clickhouse
14. ./build/./src/Interpreters/IInterpreterUnionOrSelectQuery.cpp:0: DB::IInterpreterUnionOrSelectQuery::buildQueryPipeline() @ 0x17a2803c in /mnt/ch/ClickHouse/build_default/programs/clickhouse
15. ./build/./src/Interpreters/InterpreterInsertQuery.cpp:0: DB::InterpreterInsertQuery::execute() @ 0x17a2475a in /mnt/ch/ClickHouse/build_default/programs/clickhouse
16. ./build/./src/Interpreters/executeQuery.cpp:0: DB::executeQueryImpl(char const*, char const*, std::shared_ptr<DB::Context>, bool, DB::QueryProcessingStage::Enum, DB::ReadBuffer*) @ 0x17da16cc in /mnt/ch/ClickHouse/build_default/programs/clickhouse
17. ./build/./src/Interpreters/executeQuery.cpp:1168: DB::executeQuery(String const&, std::shared_ptr<DB::Context>, bool, DB::QueryProcessingStage::Enum) @ 0x17d9ebc8 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
18. ./build/./src/Server/TCPHandler.cpp:0: DB::TCPHandler::runImpl() @ 0x18ab2ee4 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
19. ./build/./src/Server/TCPHandler.cpp:2045: DB::TCPHandler::run() @ 0x18ac3d0a in /mnt/ch/ClickHouse/build_default/programs/clickhouse
20. ./build/./base/poco/Net/src/TCPServerConnection.cpp:57: Poco::Net::TCPServerConnection::start() @ 0x1b419027 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
21. ./build/./contrib/llvm-project/libcxx/include/__memory/unique_ptr.h:48: Poco::Net::TCPServerDispatcher::run() @ 0x1b41951a in /mnt/ch/ClickHouse/build_default/programs/clickhouse
22. ./build/./base/poco/Foundation/src/ThreadPool.cpp:202: Poco::PooledThread::run() @ 0x1b58ebbb in /mnt/ch/ClickHouse/build_default/programs/clickhouse
23. ./build/./base/poco/Foundation/include/Poco/SharedPtr.h:139: Poco::ThreadImpl::runnableEntry(void*) @ 0x1b58c4d6 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
24. ? @ 0x7f3d86983bb5 in ?
25. ? @ 0x7f3d86a05d90 in ?
2023.04.27 08:14:23.001501 [ 52356 ] {2b0f6537-7470-4ac3-8ac7-54871af56daf} <Error> TCPHandler: Code: 499. DB::Exception: Failed to get object info: No response body.. HTTP response code: 400. (S3_ERROR), Stack trace (when copying this message, always include the lines below):

0. ./build/./contrib/llvm-project/libcxx/include/exception:134: Poco::Exception::Exception(String const&, int) @ 0x1b536113 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
1. ./build/./src/Common/Exception.cpp:91: DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x120953c3 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
2. DB::Exception::Exception<String const&, unsigned long>(int, FormatStringHelperImpl<std::type_identity<String const&>::type, std::type_identity<unsigned long>::type>, String const&, unsigned long&&) @ 0xdd020c7 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
3. ./build/./src/IO/S3/getObjectInfo.cpp:88: DB::S3::getObjectInfo(DB::S3::Client const&, String const&, String const&, String const&, DB::S3Settings::RequestSettings const&, bool, bool, bool) @ 0x167c5eee in /mnt/ch/ClickHouse/build_default/programs/clickhouse
4. ./build/./src/Storages/StorageS3.cpp:461: DB::StorageS3Source::KeysIterator::Impl::Impl(DB::S3::Client const&, String const&, std::vector<String, std::allocator<String>> const&, String const&, DB::S3Settings::RequestSettings const&, std::shared_ptr<DB::IAST>, DB::Block const&, std::shared_ptr<DB::Context const>, std::vector<DB::StorageS3Source::KeyWithInfo, std::allocator<DB::StorageS3Source::KeyWithInfo>>*) @ 0x183673d6 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
5. ./build/./src/Storages/StorageS3.cpp:505: DB::StorageS3Source::KeysIterator::KeysIterator(DB::S3::Client const&, String const&, std::vector<String, std::allocator<String>> const&, String const&, DB::S3Settings::RequestSettings const&, std::shared_ptr<DB::IAST>, DB::Block const&, std::shared_ptr<DB::Context const>, std::vector<DB::StorageS3Source::KeyWithInfo, std::allocator<DB::StorageS3Source::KeyWithInfo>>*) @ 0x1834d506 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
6. ./build/./contrib/llvm-project/libcxx/include/__memory/shared_ptr.h:701: DB::StorageS3::createFileIterator(DB::StorageS3::Configuration const&, bool, std::shared_ptr<DB::Context const>, std::shared_ptr<DB::IAST>, DB::Block const&, std::vector<DB::StorageS3Source::KeyWithInfo, std::allocator<DB::StorageS3Source::KeyWithInfo>>*) @ 0x183537c6 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
7. ./build/./src/Storages/StorageS3.cpp:1031: DB::StorageS3::read(std::vector<String, std::allocator<String>> const&, std::shared_ptr<DB::StorageSnapshot> const&, DB::SelectQueryInfo&, std::shared_ptr<DB::Context const>, DB::QueryProcessingStage::Enum, unsigned long, unsigned long) @ 0x18353c17 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
8. ./build/./contrib/llvm-project/libcxx/include/vector:537: DB::IStorage::read(DB::QueryPlan&, std::vector<String, std::allocator<String>> const&, std::shared_ptr<DB::StorageSnapshot> const&, DB::SelectQueryInfo&, std::shared_ptr<DB::Context const>, DB::QueryProcessingStage::Enum, unsigned long, unsigned long) @ 0x1813af48 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
9. ./build/./contrib/llvm-project/libcxx/include/__memory/shared_ptr.h:815: DB::InterpreterSelectQuery::executeFetchColumns(DB::QueryProcessingStage::Enum, DB::QueryPlan&) @ 0x17a51f11 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
10. ./build/./src/Interpreters/InterpreterSelectQuery.cpp:1427: DB::InterpreterSelectQuery::executeImpl(DB::QueryPlan&, std::optional<DB::Pipe>) @ 0x17a4b028 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
11. ./build/./contrib/llvm-project/libcxx/include/optional:260: DB::InterpreterSelectQuery::buildQueryPlan(DB::QueryPlan&) @ 0x17a4a73e in /mnt/ch/ClickHouse/build_default/programs/clickhouse
12. ./build/./src/Interpreters/InterpreterSelectWithUnionQuery.cpp:0: DB::InterpreterSelectWithUnionQuery::buildQueryPlan(DB::QueryPlan&) @ 0x17ad53b2 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
13. ./build/./contrib/llvm-project/libcxx/include/__memory/shared_ptr.h:603: DB::IInterpreterUnionOrSelectQuery::buildQueryPipeline(DB::QueryPlan&) @ 0x17a280af in /mnt/ch/ClickHouse/build_default/programs/clickhouse
14. ./build/./src/Interpreters/IInterpreterUnionOrSelectQuery.cpp:0: DB::IInterpreterUnionOrSelectQuery::buildQueryPipeline() @ 0x17a2803c in /mnt/ch/ClickHouse/build_default/programs/clickhouse
15. ./build/./src/Interpreters/InterpreterInsertQuery.cpp:0: DB::InterpreterInsertQuery::execute() @ 0x17a2475a in /mnt/ch/ClickHouse/build_default/programs/clickhouse
16. ./build/./src/Interpreters/executeQuery.cpp:0: DB::executeQueryImpl(char const*, char const*, std::shared_ptr<DB::Context>, bool, DB::QueryProcessingStage::Enum, DB::ReadBuffer*) @ 0x17da16cc in /mnt/ch/ClickHouse/build_default/programs/clickhouse
17. ./build/./src/Interpreters/executeQuery.cpp:1168: DB::executeQuery(String const&, std::shared_ptr<DB::Context>, bool, DB::QueryProcessingStage::Enum) @ 0x17d9ebc8 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
18. ./build/./src/Server/TCPHandler.cpp:0: DB::TCPHandler::runImpl() @ 0x18ab2ee4 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
19. ./build/./src/Server/TCPHandler.cpp:2045: DB::TCPHandler::run() @ 0x18ac3d0a in /mnt/ch/ClickHouse/build_default/programs/clickhouse
20. ./build/./base/poco/Net/src/TCPServerConnection.cpp:57: Poco::Net::TCPServerConnection::start() @ 0x1b419027 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
21. ./build/./contrib/llvm-project/libcxx/include/__memory/unique_ptr.h:48: Poco::Net::TCPServerDispatcher::run() @ 0x1b41951a in /mnt/ch/ClickHouse/build_default/programs/clickhouse
22. ./build/./base/poco/Foundation/src/ThreadPool.cpp:202: Poco::PooledThread::run() @ 0x1b58ebbb in /mnt/ch/ClickHouse/build_default/programs/clickhouse
23. ./build/./base/poco/Foundation/include/Poco/SharedPtr.h:139: Poco::ThreadImpl::runnableEntry(void*) @ 0x1b58c4d6 in /mnt/ch/ClickHouse/build_default/programs/clickhouse
24. ? @ 0x7f3d86983bb5 in ?
25. ? @ 0x7f3d86a05d90 in ?

With this revert on top: OK

@Algunenano

Copy link
Copy Markdown
Member Author

At this point, since 23.4 has been released, this should to be considered "bugfix" and backported

@antonio2368

antonio2368 commented May 2, 2023 •

Copy link
Copy Markdown
Member

@Algunenano thanks for reverting only part of the PR which caused the issue!
I'm taking a look but I think I have an idea of what is the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-not-for-changelog This PR should not be mentioned in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants