mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-14 10:22:10 +00:00
Better
This commit is contained in:
parent
7a631be885
commit
812fbee72e
@ -25,6 +25,7 @@ namespace DB
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int LOGICAL_ERROR;
|
||||
extern const int BAD_ARGUMENTS;
|
||||
}
|
||||
|
||||
FileSegmentMetadata::FileSegmentMetadata(FileSegmentPtr && file_segment_)
|
||||
@ -758,7 +759,7 @@ FileSegments LockedKey::sync()
|
||||
for (auto it = key_metadata->begin(); it != key_metadata->end();)
|
||||
{
|
||||
auto file_segment = it->second->file_segment;
|
||||
if (file_segment->state() != FileSegment::State::DOWNLOADED)
|
||||
if (file_segment->getDownloadedSize(false) == 0)
|
||||
{
|
||||
++it;
|
||||
continue;
|
||||
|
@ -1,2 +1,3 @@
|
||||
ok
|
||||
ok
|
||||
ok
|
||||
|
@ -46,4 +46,24 @@ $CLICKHOUSE_CLIENT --query "SYSTEM SYNC FILESYSTEM CACHE" 2>&1 | grep -q "$key"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "SELECT * FROM test FORMAT Null"
|
||||
|
||||
key=$($CLICKHOUSE_CLIENT -nm --query """
|
||||
SELECT key FROM system.filesystem_cache_log WHERE query_id = '$query_id' ORDER BY size DESC LIMIT 1;
|
||||
""")
|
||||
|
||||
offset=$($CLICKHOUSE_CLIENT -nm --query """
|
||||
SELECT offset FROM system.filesystem_cache_log WHERE query_id = '$query_id' ORDER BY size DESC LIMIT 1;
|
||||
""")
|
||||
|
||||
path=$($CLICKHOUSE_CLIENT -nm --query """
|
||||
SELECT cache_path FROM system.filesystem_cache WHERE key = '$key' AND file_segment_range_begin = $offset;
|
||||
""")
|
||||
|
||||
echo -n 'fff' > $path
|
||||
|
||||
cat $path
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "SYSTEM SYNC FILESYSTEM CACHE" 2>&1 | grep -q "$key" && echo 'ok' || echo 'fail'
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "SELECT * FROM test FORMAT Null"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "SYSTEM SYNC FILESYSTEM CACHE"
|
||||
|
Loading…
Reference in New Issue
Block a user