Commit Graph

21 Commits

Author SHA1 Message Date
kssenii
af3bb3b7af Add WriteSettings 2022-03-18 12:27:38 +01:00
Azat Khuzhin
71a99ab27c Accept real file size in createReadBufferFromFileBase()
Right now streams relies on correct file size not the number of bytes
that will be read from the stream, to overcome one bug in the linux
kernel that may return EIINVAL for pread() with offset pass the EOF.

v2: Swap read_hint and file_size (since it is easy to miss something)

Before the first argument to readFile()/createReadBufferFromFileBase()
was read_hint, not the file_size, and let's preserve the order, since
it is easy to miss something

This will also fix 02051_read_settings test automatically because now
MergeTreeReaderStream will pass estimated_sum_mark_range_bytes to
read_hint not file_size, previously it cause on of the following errors:
- Attempt to read after EOF w/ O_DIRECT
- and LOGICAL_ERROR while adjusting granulas w/o O_DIRECT

This will also improve zero-length reads guard (via
ReadBufferFromEmptyFile), that had been added in #30190

v3: fix for other storages that wasn't enabled in fast-test
v4: ignore ENOENT/ENOTSUP in readFile
2022-01-04 10:53:17 +03:00
Alexey Milovidov
8b4a6a2416 Remove cruft 2021-10-28 02:10:39 +03:00
Azat Khuzhin
2b96433daf Replace estimated_size with optional<size> for IDisk::readFile()
v2: rebase to fix conflicts in DiskEncrypted.cpp
2021-10-24 18:58:11 +03:00
Alexey Milovidov
183891eb0a Add IDisk::isRemote method 2021-08-25 02:27:20 +03:00
Alexey Milovidov
7c1d0a3baf Progress on development 2021-08-25 01:24:47 +03:00
Alexey Milovidov
d184b79bba Progress on async reads. 2021-08-16 03:00:32 +03:00
Vitaly Baranov
a05184d83a Fix synchronization while updating from the config of an encrypted disk. 2021-08-01 22:55:36 +03:00
Vitaly Baranov
51f882d8cc Support multiple keys for encrypted disk. Display error message if the key is probably wrong. 2021-07-24 23:45:12 +03:00
Vitaly Baranov
81ea8521b1 Set encryption algorithm explicitly. 2021-07-18 10:29:42 +03:00
Vitaly Baranov
9cc258327e Add comments for encrypted disks; some improvements in code. 2021-07-16 12:04:25 +03:00
Vitaly Baranov
bc5080d701 Rename ReadEncryptedBuffer -> ReadBufferFromEncryptedFile,
WriteEncryptedBuffer -> WriteBufferFromEncryptedFile,
move file FileEncryption.h to the IO folder,
rename functions accroding to our code style,
add cpp files.
2021-07-13 11:31:03 +03:00
Alexandra
5bc5a29c32 ContextConstPtr -> ContextPtr (resolve conflicts) 2021-06-18 05:36:50 +00:00
Alexandra
2bb25f356d createDir->createDirs in DiskEncrypted initialization 2021-05-23 06:49:02 +00:00
Alexandra
11e40ad000 style fixes 2021-05-19 22:06:25 +00:00
Alexandra
f71e97511b set use_ssl flag 2021-05-18 20:48:16 +00:00
Alexandra
b7a0f2db57 refactoring 2021-05-18 20:20:51 +00:00
Alexandra
721ea4f251 remove unnecessary includes 2021-05-17 16:58:51 +00:00
Alexandra
24573794ce inherit DiskEncrypted from DiskDecorator; override copy (use IDisk::copy instead of LocalDisk::copy), applyNewSettings, onFreeze and removeShared* 2021-05-14 21:52:51 +00:00
Alexandra
5374ac5c11 resolve alter table issue and add relative path to DiskEncrypted that can be declared in config as a <path> 2021-05-13 16:21:45 +00:00
Alexandra
628bf9b345 disk encryption init 2021-05-13 06:37:05 +00:00