Skip to content

Commit 1ce8ef8

Browse files
obdevfkuner
authored andcommitted
Restore fork source tablet handles in table iterator
Co-authored-by: fkuner <784819644@qq.com>
1 parent e606e71 commit 1ce8ef8

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/storage/meta_mem/ob_tablet_handle.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ int ObTabletTableIterator::assign(const ObTabletTableIterator& other)
252252
LOG_WARN("failed to build fork ctx", K(ret));
253253
} else if (OB_FAIL(fork_ctx_->fork_infos_.assign(other.fork_ctx_->fork_infos_))) {
254254
LOG_WARN("failed to assign fork infos", K(ret));
255+
} else if (OB_FAIL(fork_ctx_->fork_tablet_handles_.assign(other.fork_ctx_->fork_tablet_handles_))) {
256+
LOG_WARN("failed to assign fork tablet handles", K(ret));
255257
}
256258
}
257259
return ret;
@@ -314,8 +316,9 @@ int ObTabletTableIterator::add_fork_tablet_handle(const ObTabletHandle &tablet_h
314316
LOG_WARN("failed to build fork tablet ctx", K(ret));
315317
} else if (OB_FAIL(fork_ctx_->fork_infos_.push_back(fork_info))) {
316318
LOG_WARN("failed to push back", K(ret));
319+
} else if (OB_FAIL(fork_ctx_->fork_tablet_handles_.push_back(tablet_handle))) {
320+
LOG_WARN("failed to push back fork tablet handle", K(ret));
317321
}
318-
UNUSED(tablet_handle);
319322
return ret;
320323
}
321324

src/storage/meta_mem/ob_tablet_handle.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,19 @@ class ObTabletTableIterator final
7979
friend class ObLSTabletService;
8080
typedef ObSEArray<ObTabletHandle, 1> SplitExtraTabletHandleArray;
8181
typedef ObSEArray<share::ObForkTabletInfo, 1> ForkTabletInfoArray;
82+
typedef ObSEArray<ObTabletHandle, 1> ForkTabletHandleArray;
8283
struct ForkCtx final
8384
{
84-
ForkCtx() : fork_infos_() {}
85+
ForkCtx() : fork_infos_(), fork_tablet_handles_() {}
8586
~ForkCtx() { reset(); }
8687
void reset()
8788
{
8889
fork_infos_.reset();
90+
fork_tablet_handles_.reset();
8991
}
90-
TO_STRING_KV(K_(fork_infos));
92+
TO_STRING_KV(K_(fork_infos), K_(fork_tablet_handles));
9193
ForkTabletInfoArray fork_infos_;
94+
ForkTabletHandleArray fork_tablet_handles_;
9295
DISALLOW_COPY_AND_ASSIGN(ForkCtx);
9396
};
9497
public:

0 commit comments

Comments
 (0)