From d0b4ac476dcaaa3d4c664533bd93c089b91b2318 Mon Sep 17 00:00:00 2001 From: chejinge <945997690@qq.com> Date: Thu, 18 Apr 2024 22:21:56 +0800 Subject: [PATCH] fix:cache_disable_flag assign initial value (#2613) * fix:cache_disable_flag assign initial value --------- Co-authored-by: chejinge --- include/pika_conf.h | 30 +++++++++++++++--------------- tests/integration/txn_test.go | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/pika_conf.h b/include/pika_conf.h index ed662ad2ee..a360e15767 100644 --- a/include/pika_conf.h +++ b/include/pika_conf.h @@ -888,21 +888,21 @@ class PikaConf : public pstd::BaseConf { // cache std::vector cache_type_; - std::atomic_bool tmp_cache_disable_flag_; - std::atomic_int64_t cache_maxmemory_; - std::atomic_int cache_num_; - std::atomic_int cache_mode_; - std::atomic_int cache_string_; - std::atomic_int cache_set_; - std::atomic_int cache_zset_; - std::atomic_int cache_hash_; - std::atomic_int cache_list_; - std::atomic_int cache_bit_; - std::atomic_int zset_cache_start_direction_; - std::atomic_int zset_cache_field_num_per_key_; - std::atomic_int cache_maxmemory_policy_; - std::atomic_int cache_maxmemory_samples_; - std::atomic_int cache_lfu_decay_time_; + std::atomic_bool tmp_cache_disable_flag_ = false; + std::atomic_int64_t cache_maxmemory_ = 10737418240; + std::atomic_int cache_num_ = 5; + std::atomic_int cache_mode_ = 1; + std::atomic_int cache_string_ = 1; + std::atomic_int cache_set_ = 1; + std::atomic_int cache_zset_ = 1; + std::atomic_int cache_hash_ = 1; + std::atomic_int cache_list_ = 1; + std::atomic_int cache_bit_ = 1; + std::atomic_int zset_cache_start_direction_ = 0; + std::atomic_int zset_cache_field_num_per_key_ = 512; + std::atomic_int cache_maxmemory_policy_ = 1; + std::atomic_int cache_maxmemory_samples_ = 5; + std::atomic_int cache_lfu_decay_time_ = 1; // rocksdb blob bool enable_blob_files_ = false; diff --git a/tests/integration/txn_test.go b/tests/integration/txn_test.go index 3161122a4b..193560c99b 100644 --- a/tests/integration/txn_test.go +++ b/tests/integration/txn_test.go @@ -134,7 +134,7 @@ var _ = Describe("Text Txn", func() { }(&cmdCost) <-resultChann wg.Wait() - Expect(cmdCost < (txnCost / 4)).To(BeTrue()) + Expect(cmdCost < (txnCost / 2)).To(BeTrue()) }) })