Add system table with blob storage operations log#52918
Conversation
|
This is an automated comment for commit 1523447 with description of existing statuses. It's updated for the latest CI running ❌ Click here to open a full report in a separate page Successful checks
|
d00cb2c to
9dd3c0e
Compare
bd02979 to
c1f5dce
Compare
| namespace DB | ||
| { | ||
|
|
||
| struct BlobStorageLogElement |
There was a problem hiding this comment.
Is it possible to:
- add the compressed size in bytes?
- add a new event_type DeleteFailed in case of a blob has been not removed from s3 due to some errors.
There was a problem hiding this comment.
Will add data size for upload operations.
Table will have error_msg column, I'll try to do best to have a records for failed queries. However, it can be some network error, so non-empty error_msg doesn't mean that object was not deleted, because we cannot know for sure if request have reached s3 or not.
There was a problem hiding this comment.
7fdfe82 to
3372508
Compare
64a5446 to
1d32d42
Compare
dd633a1 to
27505f9
Compare
@kssenii you may take a look on the PR |
src/IO/S3/BlobStorageLogWriter.cpp
Outdated
| element.remote_path = remote_path; | ||
| element.local_path = local_path_.empty() ? local_path : local_path_; | ||
|
|
||
| if (data_size > std::numeric_limits<decltype(element.data_size)>::max()) |
There was a problem hiding this comment.
how is it possible if data_size is size_t and element.data_size is UInt32?
There was a problem hiding this comment.
At first I aimed to store UInt32 in table to save space, but I don't think it will be significant, changed to UInt64 and removed the check
|
|
||
| UInt32 data_size; | ||
|
|
||
| Int32 error_code = -1; /// negative if no error |
There was a problem hiding this comment.
|
|
||
| auto clients_ = clients.get(); | ||
|
|
||
| BlobStorageLogWriter blob_storage_log = getBlobStorageLog(); |
There was a problem hiding this comment.
Should there be a way to enable/disable writing to blob_storage_log with a query/profile setting?
There was a problem hiding this comment.
I don't think it make lot's of sense, since user can configure it in server level config. In that case it can be used to debug some issues connected with missing or unexpected blobs. If logging is disabled for half of the requests it will not be helpful anymore, so probably it may be just disabled in config.
| BlobStorageLogWriter S3ObjectStorage::getBlobStorageLog() | ||
| { | ||
| #ifndef CLICKHOUSE_KEEPER_STANDALONE_BUILD /// Keeper standalone build doesn't have context | ||
| /// Make a copy with local properties like query_id, object path, etc | ||
| BlobStorageLogWriter blob_storage_log(Context::getGlobalContextInstance()->getBlobStorageLog()); | ||
| blob_storage_log.disk_name = disk_name; | ||
|
|
There was a problem hiding this comment.
May be it could be better if getBlobStorageLog returned a pointer instead of an object and it will be nullptr if context->getBlobStorageLog() returns nullptr (or if it is disabled with query setting), this will allow to avoid redundant work with checking query context below and then calling addEvent if the no event will actually be added because log is nullptr. Also there are places where we do addEvent in a loop for many objects, but there is no point in doing it if log is not initialized or disabled.
There was a problem hiding this comment.
Replaced BlobStorageLogWriter with BlobStorageLogWriterPtr. Initially I didn't want to check
if (blob_log)
blob_log->addEvent(...)each time, but as you mentioned having plain object BlobStorageLogWriter also have some drawbacks, so pointer is good.
00b52d4 to
cd6560f
Compare
@kssenii you may check an updated code |
64c6c74 to
a65279a
Compare
a65279a to
1523447
Compare
…22) (#3802) * [GLUTEN-1632][CH]Daily Update Clickhouse Version (20231122) * fix build due to ClickHouse/ClickHouse#52918 * [Gluten-3769] Revert Fix due to 20231117(#3756) upgrade --------- Co-authored-by: kyligence-git <[email protected]> Co-authored-by: Chang Chen <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
blob_storage_logDocumentation entry for user-facing changes