This is part of **"Why my PR is not merged?"** patch set series.
Since #50107 there one more tunable that can increase the cleanup period
- max_cleanup_delay_period.
Plus, increase the delay for the cleanup thread, otherwise it is too
fragile.
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
If Entry::disconnect() is called, it is removed from its pool
and underlying mysqlxx::Connection is disconnected.
Since Entry objects are copyable and some of them could be alive when disconnect() is called
which would lead to undefined behavior.
Suggesting to disconnect it when the last object is being destroyed.
send_metadata changes the filenames (includes revision), while
s3_plain do not care about this, and expect that the file name
will not be changed.
So during initialization s3_plain will do some basic checks and will
write file clickhouse_access_check_e0f72fcc-d6f8-44fe-8997-96cb87767515, but instead
r0000000000000000000000000000000000000000000000000000000000000001-file-clickhouse_access_check_e0f72fcc-d6f8-44fe-8997-96cb87767515
will be written, later read will not find the file and it will fail:
Application: Code: 33. DB::Exception: Cannot read all data. Bytes read: 0. Bytes expected: 4.: While checking access for disk s3_plain: Cannot attach table `system`.`crash_log` ...
And besides, send_metadata does not make sense for s3_plain.
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
The SipHash-128 values of the strings are calculated and stored in
a set when the UniqExact aggregate function is applied to a Column-
String, as the following snippet shows:
StringRef value = column.getDataAt(row_num);
UInt128 key;
SipHash hash;
hash.update(value.data, value.size);
hash.get128(key);
The implementation of SipHash requires an internal 8-byte buffer,
current_word (or current_bytes), for holding the input data in the
cross function calls of SipHash::update and SipHash::get128. But,
in the above situation, where the update and get128 only take place
once, the copy of input data to the buffer is unnecessary.
With get128 inlined, the compiler could optimize the code as a whole
and reduce the unexpected memory operations, and as a result, the
query performance is improved.