Skip to content

Commit 4749e9b

Browse files
fix: reorder shard field order to solve crash upon stop (#358)
1 parent 468d501 commit 4749e9b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

include/storage/shard.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <boost/context/protected_fixedsize_stack.hpp>
55
#include <cstdio>
66
#include <ctime>
7+
#include <memory>
78
#include <utility> // NOLINT(build/include_order)
89

910
#include "circular_queue.h"
@@ -192,14 +193,14 @@ class Shard
192193
moodycamel::BlockingConcurrentQueue<KvRequest *> requests_;
193194
std::thread thd_;
194195
PagesPool page_pool_;
195-
std::unique_ptr<AsyncIoManager> io_mgr_;
196-
IndexPageManager index_mgr_;
197196
TaskManager task_mgr_;
198197
#ifndef NDEBUG
199198
boost::context::protected_fixedsize_stack stack_allocator_;
200199
#else
201200
boost::context::pooled_fixedsize_stack stack_allocator_;
202201
#endif
202+
std::unique_ptr<AsyncIoManager> io_mgr_;
203+
IndexPageManager index_mgr_;
203204

204205
class PendingWriteQueue
205206
{

src/storage/shard.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ Shard::Shard(const EloqStore *store, size_t shard_id, uint32_t fd_limit)
4545
: store_(store),
4646
shard_id_(shard_id),
4747
page_pool_(&store->options_),
48-
io_mgr_(AsyncIoManager::Instance(store, fd_limit)),
49-
index_mgr_(io_mgr_.get()),
5048
task_mgr_(&store->options_),
51-
stack_allocator_(store->options_.coroutine_stack_size)
49+
stack_allocator_(store->options_.coroutine_stack_size),
50+
io_mgr_(AsyncIoManager::Instance(store, fd_limit)),
51+
index_mgr_(io_mgr_.get())
5252
{
5353
const auto &opts = store_->options_;
5454
oss_enabled_ = !opts.store_path.empty() && !opts.cloud_store_path.empty();

0 commit comments

Comments
 (0)