Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
c95f074b
Commit
c95f074b
authored
Jan 17, 2008
by
Bradley C. Kuszmaul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set child properly. Addresses #27.
git-svn-id:
file:///svn/tokudb@1718
c7de825b-a66e-492c-adef-691d508d4ae1
parent
ff66d1e5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
2 deletions
+54
-2
newbrt/brt.c
newbrt/brt.c
+4
-0
newbrt/roll.c
newbrt/roll.c
+49
-2
src/tests/Makefile
src/tests/Makefile
+1
-0
No files found.
newbrt/brt.c
View file @
c95f074b
...
@@ -1613,8 +1613,12 @@ static int brt_init_new_root(BRT brt, BRTNODE nodea, BRTNODE nodeb, DBT splitk,
...
@@ -1613,8 +1613,12 @@ static int brt_init_new_root(BRT brt, BRTNODE nodea, BRTNODE nodeb, DBT splitk,
//verify_local_fingerprint_nonleaf(nodea);
//verify_local_fingerprint_nonleaf(nodea);
//verify_local_fingerprint_nonleaf(nodeb);
//verify_local_fingerprint_nonleaf(nodeb);
r
=
toku_log_newbrtnode
(
txn
,
toku_txn_get_txnid
(
txn
),
toku_cachefile_filenum
(
brt
->
cf
),
newroot_diskoff
,
new_height
,
new_nodesize
,
(
brt
->
flags
&
TOKU_DB_DUPSORT
)
!=
0
,
newroot
->
rand4fingerprint
);
r
=
toku_log_newbrtnode
(
txn
,
toku_txn_get_txnid
(
txn
),
toku_cachefile_filenum
(
brt
->
cf
),
newroot_diskoff
,
new_height
,
new_nodesize
,
(
brt
->
flags
&
TOKU_DB_DUPSORT
)
!=
0
,
newroot
->
rand4fingerprint
);
if
(
r
!=
0
)
return
r
;
printf
(
"doing addchild
\n
"
);
r
=
toku_log_addchild
(
txn
,
toku_txn_get_txnid
(
txn
),
toku_cachefile_filenum
(
brt
->
cf
),
newroot_diskoff
,
0
);
r
=
toku_log_addchild
(
txn
,
toku_txn_get_txnid
(
txn
),
toku_cachefile_filenum
(
brt
->
cf
),
newroot_diskoff
,
0
);
if
(
r
!=
0
)
return
r
;
if
(
r
!=
0
)
return
r
;
r
=
toku_log_addchild
(
txn
,
toku_txn_get_txnid
(
txn
),
toku_cachefile_filenum
(
brt
->
cf
),
newroot_diskoff
,
1
);
if
(
r
!=
0
)
return
r
;
r
=
toku_log_setchild
(
txn
,
toku_txn_get_txnid
(
txn
),
toku_cachefile_filenum
(
brt
->
cf
),
newroot_diskoff
,
0
,
nodea
->
thisnodename
);
r
=
toku_log_setchild
(
txn
,
toku_txn_get_txnid
(
txn
),
toku_cachefile_filenum
(
brt
->
cf
),
newroot_diskoff
,
0
,
nodea
->
thisnodename
);
if
(
r
!=
0
)
return
r
;
if
(
r
!=
0
)
return
r
;
r
=
toku_log_setchild
(
txn
,
toku_txn_get_txnid
(
txn
),
toku_cachefile_filenum
(
brt
->
cf
),
newroot_diskoff
,
1
,
nodeb
->
thisnodename
);
r
=
toku_log_setchild
(
txn
,
toku_txn_get_txnid
(
txn
),
toku_cachefile_filenum
(
brt
->
cf
),
newroot_diskoff
,
1
,
nodeb
->
thisnodename
);
...
...
newbrt/roll.c
View file @
c95f074b
...
@@ -204,7 +204,38 @@ int toku_rollback_newbrtnode (struct logtype_newbrtnode *le, TOKUTXN txn) {
...
@@ -204,7 +204,38 @@ int toku_rollback_newbrtnode (struct logtype_newbrtnode *le, TOKUTXN txn) {
int
toku_rollback_addchild
(
struct
logtype_addchild
*
le
,
TOKUTXN
txn
)
ABORTIT
int
toku_rollback_addchild
(
struct
logtype_addchild
*
le
,
TOKUTXN
txn
)
ABORTIT
void
toku_recover_addchild
(
struct
logtype_addchild
*
le
)
{
le
=
le
;
abort
();
}
void
toku_recover_addchild
(
struct
logtype_addchild
*
le
)
{
struct
cf_pair
*
pair
;
int
r
=
find_cachefile
(
le
->
filenum
,
&
pair
);
assert
(
r
==
0
);
void
*
node_v
;
assert
(
pair
->
brt
);
r
=
toku_cachetable_get_and_pin
(
pair
->
cf
,
le
->
diskoff
,
&
node_v
,
NULL
,
toku_brtnode_flush_callback
,
toku_brtnode_fetch_callback
,
pair
->
brt
);
assert
(
r
==
0
);
BRTNODE
node
=
node_v
;
assert
(
node
->
height
>
0
);
assert
(
le
->
childnum
<=
(
unsigned
)
node
->
u
.
n
.
n_children
);
unsigned
int
i
;
for
(
i
=
node
->
u
.
n
.
n_children
;
i
+
1
>
le
->
childnum
;
i
--
)
{
node
->
u
.
n
.
childinfos
[
i
]
=
node
->
u
.
n
.
childinfos
[
i
-
1
];
BRTNODE_CHILD_DISKOFF
(
node
,
i
)
=
BRTNODE_CHILD_DISKOFF
(
node
,
i
-
1
);
node
->
u
.
n
.
buffers
[
i
]
=
node
->
u
.
n
.
buffers
[
i
-
1
];
node
->
u
.
n
.
n_bytes_in_buffer
[
i
]
=
node
->
u
.
n
.
n_bytes_in_buffer
[
i
-
1
];
node
->
u
.
n
.
n_cursors
[
i
]
=
node
->
u
.
n
.
n_cursors
[
i
-
1
];
if
(
i
!=
(
unsigned
int
)
node
->
u
.
n
.
n_children
)
{
node
->
u
.
n
.
childkeys
[
i
]
=
node
->
u
.
n
.
childkeys
[
i
-
1
];
}
}
node
->
u
.
n
.
childinfos
[
le
->
childnum
].
subtree_fingerprint
=
0
;
node
->
u
.
n
.
childkeys
[
le
->
childnum
]
=
0
;
node
->
u
.
n
.
children
[
le
->
childnum
]
=
-
1
;
node
->
u
.
n
.
buffers
[
le
->
childnum
]
=
0
;
node
->
u
.
n
.
n_bytes_in_buffer
[
le
->
childnum
]
=
0
;
node
->
u
.
n
.
n_cursors
[
le
->
childnum
]
=
0
;
node
->
u
.
n
.
n_children
++
;
r
=
toku_cachetable_unpin
(
pair
->
cf
,
le
->
diskoff
,
1
,
toku_serialize_brtnode_size
(
node
));
assert
(
r
==
0
);
}
int
toku_rollback_setchild
(
struct
logtype_setchild
*
le
,
TOKUTXN
txn
)
ABORTIT
int
toku_rollback_setchild
(
struct
logtype_setchild
*
le
,
TOKUTXN
txn
)
ABORTIT
void
toku_recover_setchild
(
struct
logtype_setchild
*
le
)
{
void
toku_recover_setchild
(
struct
logtype_setchild
*
le
)
{
...
@@ -223,7 +254,23 @@ void toku_recover_setchild (struct logtype_setchild *le) {
...
@@ -223,7 +254,23 @@ void toku_recover_setchild (struct logtype_setchild *le) {
assert
(
r
==
0
);
assert
(
r
==
0
);
}
}
int
toku_rollback_setpivot
(
struct
logtype_setpivot
*
le
,
TOKUTXN
txn
)
ABORTIT
int
toku_rollback_setpivot
(
struct
logtype_setpivot
*
le
,
TOKUTXN
txn
)
ABORTIT
void
toku_recover_setpivot
(
struct
logtype_setpivot
*
le
)
{
le
=
le
;
abort
();
}
void
toku_recover_setpivot
(
struct
logtype_setpivot
*
le
)
{
struct
cf_pair
*
pair
;
int
r
=
find_cachefile
(
le
->
filenum
,
&
pair
);
assert
(
r
==
0
);
void
*
node_v
;
assert
(
pair
->
brt
);
r
=
toku_cachetable_get_and_pin
(
pair
->
cf
,
le
->
diskoff
,
&
node_v
,
NULL
,
toku_brtnode_flush_callback
,
toku_brtnode_fetch_callback
,
pair
->
brt
);
assert
(
r
==
0
);
BRTNODE
node
=
node_v
;
assert
(
node
->
height
>
0
);
node
->
u
.
n
.
childkeys
[
le
->
childnum
]
=
kv_pair_malloc
(
le
->
pivotkey
.
data
,
le
->
pivotkey
.
len
,
0
,
0
);
r
=
toku_cachetable_unpin
(
pair
->
cf
,
le
->
diskoff
,
1
,
toku_serialize_brtnode_size
(
node
));
assert
(
r
==
0
);
toku_free
(
le
->
pivotkey
.
data
);
}
void
toku_recover_fopen
(
struct
logtype_fopen
*
c
)
{
void
toku_recover_fopen
(
struct
logtype_fopen
*
c
)
{
char
*
fname
=
fixup_fname
(
&
c
->
fname
);
char
*
fname
=
fixup_fname
(
&
c
->
fname
);
...
...
src/tests/Makefile
View file @
c95f074b
...
@@ -151,6 +151,7 @@ libs:
...
@@ -151,6 +151,7 @@ libs:
all.recover
:
test_log2.recover test_log3.recover test_log4.recover test_log5.recover
all.recover
:
test_log2.recover test_log3.recover test_log4.recover test_log5.recover
%.recover
:
%.tdb
%.recover
:
%.tdb
$(MAYBEATSIGN)
cd
../../newbrt
;
make
$(VERBQUIET)
recover
;
make
$(VERBQUIET)
$(MAYBEATSIGN)
cd
../../newbrt
;
make
$(VERBQUIET)
recover
;
make
$(VERBQUIET)
$(MAYBEATSIGN)
cd
..
;
make
$(VERBQUIET)
$(MAYBEATSIGN)
$(VGRIND)
./
$<
$(MAYBEATSIGN)
$(VGRIND)
./
$<
$(MAYBEATSIGN)
rm
-rf
dir.
$(
patsubst
%.tdb,%.c.tdb,
$<
)
.recover
$(MAYBEATSIGN)
rm
-rf
dir.
$(
patsubst
%.tdb,%.c.tdb,
$<
)
.recover
$(MAYBEATSIGN)
mkdir
dir.
$(
patsubst
%.tdb,%.c.tdb,
$<
)
.recover
$(MAYBEATSIGN)
mkdir
dir.
$(
patsubst
%.tdb,%.c.tdb,
$<
)
.recover
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment