Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
indiff7643
Terarkdb
提交
2fa9bf2b
T
Terarkdb
项目概览
indiff7643
/
Terarkdb
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Terarkdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2fa9bf2b
编写于
1月 26, 2021
作者:
L
Layamon
提交者:
ZhaoMing
2月 08, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[reseek bugfix] add reseekdone flag
上级
ba4aaa07
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
7 addition
and
3 deletion
+7
-3
db/db_iter.cc
db/db_iter.cc
+7
-2
utilities/transactions/write_prepared_txn.cc
utilities/transactions/write_prepared_txn.cc
+0
-1
未找到文件。
db/db_iter.cc
浏览文件 @
2fa9bf2b
...
@@ -429,7 +429,7 @@ bool DBIter::FindNextUserEntryInternal(bool skipping, bool prefix_check) {
...
@@ -429,7 +429,7 @@ bool DBIter::FindNextUserEntryInternal(bool skipping, bool prefix_check) {
// greater than that,
// greater than that,
// - none of the above : saved_key_ can contain anything, it doesn't matter.
// - none of the above : saved_key_ can contain anything, it doesn't matter.
uint64_t
num_skipped
=
0
;
uint64_t
num_skipped
=
0
;
bool
reseek_done
=
false
;
do
{
do
{
if
(
!
ParseKey
(
&
ikey_
))
{
if
(
!
ParseKey
(
&
ikey_
))
{
return
false
;
return
false
;
...
@@ -457,6 +457,7 @@ bool DBIter::FindNextUserEntryInternal(bool skipping, bool prefix_check) {
...
@@ -457,6 +457,7 @@ bool DBIter::FindNextUserEntryInternal(bool skipping, bool prefix_check) {
PERF_COUNTER_ADD
(
internal_key_skipped_count
,
1
);
PERF_COUNTER_ADD
(
internal_key_skipped_count
,
1
);
}
else
{
}
else
{
num_skipped
=
0
;
num_skipped
=
0
;
reseek_done
=
false
;
switch
(
ikey_
.
type
)
{
switch
(
ikey_
.
type
)
{
case
kTypeDeletion
:
case
kTypeDeletion
:
case
kTypeSingleDeletion
:
case
kTypeSingleDeletion
:
...
@@ -500,6 +501,7 @@ bool DBIter::FindNextUserEntryInternal(bool skipping, bool prefix_check) {
...
@@ -500,6 +501,7 @@ bool DBIter::FindNextUserEntryInternal(bool skipping, bool prefix_check) {
// they are hidden by this deletion.
// they are hidden by this deletion.
skipping
=
true
;
skipping
=
true
;
num_skipped
=
0
;
num_skipped
=
0
;
reseek_done
=
false
;
PERF_COUNTER_ADD
(
internal_delete_skipped_count
,
1
);
PERF_COUNTER_ADD
(
internal_delete_skipped_count
,
1
);
}
else
{
}
else
{
value_
=
GetValue
(
ikey_
,
kTypeValueIndex
);
value_
=
GetValue
(
ikey_
,
kTypeValueIndex
);
...
@@ -517,6 +519,7 @@ bool DBIter::FindNextUserEntryInternal(bool skipping, bool prefix_check) {
...
@@ -517,6 +519,7 @@ bool DBIter::FindNextUserEntryInternal(bool skipping, bool prefix_check) {
// they are hidden by this deletion.
// they are hidden by this deletion.
skipping
=
true
;
skipping
=
true
;
num_skipped
=
0
;
num_skipped
=
0
;
reseek_done
=
false
;
PERF_COUNTER_ADD
(
internal_delete_skipped_count
,
1
);
PERF_COUNTER_ADD
(
internal_delete_skipped_count
,
1
);
}
else
{
}
else
{
// By now, we are sure the current ikey is going to yield a
// By now, we are sure the current ikey is going to yield a
...
@@ -545,13 +548,15 @@ bool DBIter::FindNextUserEntryInternal(bool skipping, bool prefix_check) {
...
@@ -545,13 +548,15 @@ bool DBIter::FindNextUserEntryInternal(bool skipping, bool prefix_check) {
saved_key_
.
SetUserKey
(
ikey_
.
user_key
);
saved_key_
.
SetUserKey
(
ikey_
.
user_key
);
skipping
=
false
;
skipping
=
false
;
num_skipped
=
0
;
num_skipped
=
0
;
reseek_done
=
false
;
}
}
}
}
// If we have sequentially iterated via numerous equal keys, then it's
// If we have sequentially iterated via numerous equal keys, then it's
// better to seek so that we can avoid too many key comparisons.
// better to seek so that we can avoid too many key comparisons.
if
(
num_skipped
>
max_skip_
&&
CanReseekToSkip
()
)
{
if
(
num_skipped
>
max_skip_
&&
!
reseek_done
)
{
num_skipped
=
0
;
num_skipped
=
0
;
reseek_done
=
true
;
std
::
string
last_key
;
std
::
string
last_key
;
if
(
skipping
)
{
if
(
skipping
)
{
// We're looking for the next user-key but all we see are the same
// We're looking for the next user-key but all we see are the same
...
...
utilities/transactions/write_prepared_txn.cc
浏览文件 @
2fa9bf2b
...
@@ -102,7 +102,6 @@ Status WritePreparedTxn::PrepareInternal() {
...
@@ -102,7 +102,6 @@ Status WritePreparedTxn::PrepareInternal() {
assert
(
!
s
.
ok
()
||
seq_used
!=
kMaxSequenceNumber
);
assert
(
!
s
.
ok
()
||
seq_used
!=
kMaxSequenceNumber
);
auto
prepare_seq
=
seq_used
;
auto
prepare_seq
=
seq_used
;
SetId
(
prepare_seq
);
SetId
(
prepare_seq
);
TEST_SYNC_POINT_CALLBACK
(
"WritePreparedTxn::PrepareInternal::End"
,
nullptr
);
return
s
;
return
s
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录