mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
fix and add test for system.filesystem_cache_log
This commit is contained in:
parent
e1acacf831
commit
1145570c08
@ -72,10 +72,10 @@ void CachedReadBufferFromRemoteFS::appendFilesystemCacheLog(
|
|||||||
elem.read_type = FilesystemCacheLogElement::ReadType::READ_FROM_CACHE;
|
elem.read_type = FilesystemCacheLogElement::ReadType::READ_FROM_CACHE;
|
||||||
break;
|
break;
|
||||||
case CachedReadBufferFromRemoteFS::ReadType::REMOTE_FS_READ_BYPASS_CACHE:
|
case CachedReadBufferFromRemoteFS::ReadType::REMOTE_FS_READ_BYPASS_CACHE:
|
||||||
elem.read_type = FilesystemCacheLogElement::ReadType::READ_FROM_FS_AND_DOWNLOADED_TO_CACHE;
|
elem.read_type = FilesystemCacheLogElement::ReadType::READ_FROM_FS_BYPASSING_CACHE;
|
||||||
break;
|
break;
|
||||||
case CachedReadBufferFromRemoteFS::ReadType::REMOTE_FS_READ_AND_PUT_IN_CACHE:
|
case CachedReadBufferFromRemoteFS::ReadType::REMOTE_FS_READ_AND_PUT_IN_CACHE:
|
||||||
elem.read_type = FilesystemCacheLogElement::ReadType::READ_FROM_FS_BYPASSING_CACHE;
|
elem.read_type = FilesystemCacheLogElement::ReadType::READ_FROM_FS_AND_DOWNLOADED_TO_CACHE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,18 @@
|
|||||||
|
-- { echo }
|
||||||
|
|
||||||
|
SYSTEM DROP FILESYSTEM CACHE;
|
||||||
|
SET enable_filesystem_cache_log=1;
|
||||||
|
SET enable_filesystem_cache_on_write_operations=0;
|
||||||
|
DROP TABLE IF EXISTS test;
|
||||||
|
DROP TABLE IF EXISTS system.filesystem_cache_log;
|
||||||
|
CREATE TABLE test (key UInt32, value String) Engine=MergeTree() ORDER BY key SETTINGS storage_policy='only_s3', min_bytes_for_wide_part = 10485760;
|
||||||
|
INSERT INTO test SELECT number, toString(number) FROM numbers(100000);
|
||||||
|
SELECT * FROM test FORMAT Null;
|
||||||
|
SYSTEM FLUSH LOGS;
|
||||||
|
SELECT file_segment_range, read_type FROM system.filesystem_cache_log WHERE read_type='READ_FROM_FS_AND_DOWNLOADED_TO_CACHE';
|
||||||
|
(0,519) READ_FROM_FS_AND_DOWNLOADED_TO_CACHE
|
||||||
|
(0,808110) READ_FROM_FS_AND_DOWNLOADED_TO_CACHE
|
||||||
|
SELECT * FROM test FORMAT Null;
|
||||||
|
SYSTEM FLUSH LOGS;
|
||||||
|
SELECT file_segment_range, read_type FROM system.filesystem_cache_log WHERE read_type='READ_FROM_CACHE';
|
||||||
|
(0,808110) READ_FROM_CACHE
|
@ -0,0 +1,20 @@
|
|||||||
|
-- Tags: no-parallel, no-fasttest, no-s3-storage
|
||||||
|
|
||||||
|
-- { echo }
|
||||||
|
|
||||||
|
SYSTEM DROP FILESYSTEM CACHE;
|
||||||
|
SET enable_filesystem_cache_log=1;
|
||||||
|
SET enable_filesystem_cache_on_write_operations=0;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS test;
|
||||||
|
DROP TABLE IF EXISTS system.filesystem_cache_log;
|
||||||
|
CREATE TABLE test (key UInt32, value String) Engine=MergeTree() ORDER BY key SETTINGS storage_policy='s3_cache', min_bytes_for_wide_part = 10485760;
|
||||||
|
INSERT INTO test SELECT number, toString(number) FROM numbers(100000);
|
||||||
|
|
||||||
|
SELECT * FROM test FORMAT Null;
|
||||||
|
SYSTEM FLUSH LOGS;
|
||||||
|
SELECT file_segment_range, read_type FROM system.filesystem_cache_log WHERE read_type='READ_FROM_FS_AND_DOWNLOADED_TO_CACHE';
|
||||||
|
|
||||||
|
SELECT * FROM test FORMAT Null;
|
||||||
|
SYSTEM FLUSH LOGS;
|
||||||
|
SELECT file_segment_range, read_type FROM system.filesystem_cache_log WHERE read_type='READ_FROM_CACHE';
|
Loading…
Reference in New Issue
Block a user