Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dbms/src/Common/FailPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ std::unordered_map<String, std::shared_ptr<FailPointChannel>> FailPointHelper::f
M(exception_mpp_hash_build) \
M(exception_before_drop_segment) \
M(exception_after_drop_segment) \
M(exception_between_schema_change_in_the_same_diff)
M(exception_between_schema_change_in_the_same_diff) \
M(force_ps_wal_compact)

#define APPLY_FOR_FAILPOINTS(M) \
M(skip_check_segment_update) \
Expand Down
18 changes: 14 additions & 4 deletions dbms/src/Encryption/tests/gtest_encryption_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,24 @@ TEST_P(EncryptionTest, EncryptionTest)
EXPECT_TRUE(testEncryption(16, 16 * 2, test::IV_OVERFLOW_FULL));
}

INSTANTIATE_TEST_CASE_P(
EncryptionTestInstance,
EncryptionTest,
testing::Combine(
testing::Bool(),
testing::Values(
EncryptionMethod::Aes128Ctr,
EncryptionMethod::Aes192Ctr,
EncryptionMethod::Aes256Ctr,
#if USE_GM_SSL
INSTANTIATE_TEST_CASE_P(EncryptionTestInstance, EncryptionTest, testing::Combine(testing::Bool(), testing::Values(EncryptionMethod::Aes128Ctr, EncryptionMethod::Aes192Ctr, EncryptionMethod::Aes256Ctr, EncryptionMethod::SM4Ctr)));
EncryptionMethod::SM4Ctr
#elif OPENSSL_VERSION_NUMBER < 0x1010100fL || defined(OPENSSL_NO_SM4)
INSTANTIATE_TEST_CASE_P(EncryptionTestInstance, EncryptionTest, testing::Combine(testing::Bool(), testing::Values(EncryptionMethod::Aes128Ctr, EncryptionMethod::Aes192Ctr, EncryptionMethod::Aes256Ctr)));
// not support SM4
#else
// Openssl support SM4 after 1.1.1 release version.
INSTANTIATE_TEST_CASE_P(EncryptionTestInstance, EncryptionTest, testing::Combine(testing::Bool(), testing::Values(EncryptionMethod::Aes128Ctr, EncryptionMethod::Aes192Ctr, EncryptionMethod::Aes256Ctr, EncryptionMethod::SM4Ctr)));
// Openssl support SM4 after 1.1.1 release version.
EncryptionMethod::SM4Ctr
#endif
)));


TEST(PosixWritableFileTest, test)
Expand Down
9 changes: 6 additions & 3 deletions dbms/src/Storages/Page/V3/BlobStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,23 @@
#include <Common/ProfileEvents.h>
#include <Common/StringUtils/StringUtils.h>
#include <Common/TiFlashMetrics.h>
#include <Common/formatReadable.h>
#include <Poco/File.h>
#include <Storages/Page/FileUsage.h>
#include <Storages/Page/PageDefines.h>
#include <Storages/Page/V3/BlobStore.h>
#include <Storages/Page/V3/PageDirectory.h>
#include <Storages/Page/V3/PageEntriesEdit.h>
#include <Storages/Page/V3/PageEntry.h>
#include <Storages/Page/WriteBatch.h>
#include <boost_wrapper/string_split.h>
#include <common/logger_useful.h>

#include <boost/algorithm/string/classification.hpp>
#include <ext/scope_guard.h>
#include <iterator>
#include <mutex>
#include <unordered_map>

namespace ProfileEvents
{
Expand Down Expand Up @@ -1005,7 +1008,7 @@ std::vector<BlobFileId> BlobStore::getGCStats()
// Check if GC is required
if (stat->sm_valid_rate <= config.heavy_gc_valid_rate)
{
LOG_TRACE(log, "Current [blob_id={}] valid rate is {:.2f}, Need do compact GC", stat->id, stat->sm_valid_rate);
LOG_TRACE(log, "Current [blob_id={}] valid rate is {:.2f}, full GC", stat->id, stat->sm_valid_rate);
blob_need_gc.emplace_back(stat->id);

// Change current stat to read only
Expand All @@ -1015,7 +1018,7 @@ std::vector<BlobFileId> BlobStore::getGCStats()
else
{
blobstore_gc_info.appendToNoNeedGCBlob(stat->id, stat->sm_valid_rate);
LOG_TRACE(log, "Current [blob_id={}] valid rate is {:.2f}, No need to GC.", stat->id, stat->sm_valid_rate);
LOG_TRACE(log, "Current [blob_id={}] valid rate is {:.2f}, no need to GC", stat->id, stat->sm_valid_rate);
}

if (right_margin != stat->sm_total_size)
Expand Down Expand Up @@ -1049,7 +1052,7 @@ PageEntriesEdit BlobStore::gc(std::map<BlobFileId, PageIdAndVersionedEntries> &
{
throw Exception("BlobStore can't do gc if nothing need gc.", ErrorCodes::LOGICAL_ERROR);
}
LOG_INFO(log, "BlobStore gc will migrate {:.2f}MB into new Blobs", (1.0 * total_page_size / DB::MB));
LOG_INFO(log, "BlobStore gc will migrate {} into new blob files", formatReadableSizeWithBinarySuffix(total_page_size));

auto write_blob = [this, total_page_size, &written_blobs, &write_limiter](const BlobFileId & file_id,
char * data_begin,
Expand Down
Loading