From 57971bf439c4caec65f8425a50884dd1acdb52a0 Mon Sep 17 00:00:00 2001 From: obdev Date: Wed, 8 Jun 2022 20:01:15 +0800 Subject: [PATCH] bugfix: auto extend fail when restart observer --- src/storage/blocksstable/ob_local_file_system.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/storage/blocksstable/ob_local_file_system.cpp b/src/storage/blocksstable/ob_local_file_system.cpp index 35557ecfed..68d7274204 100644 --- a/src/storage/blocksstable/ob_local_file_system.cpp +++ b/src/storage/blocksstable/ob_local_file_system.cpp @@ -315,6 +315,12 @@ int ObLocalFileSystem::init(const ObStorageEnv& storage_env, ObPartitionService& } } } + // auto extend ssblock file will not change conf file item, + // in this case, if restart ob system, data_file_size_ and + // total_file_size_ in super block will be difference, + if(data_file_size_ != super_block_.content_.total_file_size_) { + data_file_size_ = super_block_.content_.total_file_size_; + } } else { // empty file system, init it if (OB_FAIL(super_block_.format_startup_super_block(storage_env.default_block_size_, data_file_size_))) { -- GitLab