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
63bc7424
Commit
63bc7424
authored
Jun 24, 2013
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#17 gracefull db open
parent
a881aeae
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
23 deletions
+43
-23
ft/ft-ops.cc
ft/ft-ops.cc
+8
-5
ft/roll.cc
ft/roll.cc
+0
-1
portability/portability.cc
portability/portability.cc
+35
-17
No files found.
ft/ft-ops.cc
View file @
63bc7424
...
@@ -3534,10 +3534,13 @@ static int ft_create_file(FT_HANDLE UU(brt), const char *fname, int *fdp) {
...
@@ -3534,10 +3534,13 @@ static int ft_create_file(FT_HANDLE UU(brt), const char *fname, int *fdp) {
}
}
r
=
toku_fsync_directory
(
fname
);
r
=
toku_fsync_directory
(
fname
);
resource_assert_zero
(
r
);
if
(
r
==
0
)
{
*
fdp
=
fd
;
*
fdp
=
fd
;
}
else
{
return
0
;
int
rr
=
close
(
fd
);
assert_zero
(
rr
);
}
return
r
;
}
}
// open a file for use by the brt. if the file does not exist, error
// open a file for use by the brt. if the file does not exist, error
...
@@ -3687,7 +3690,7 @@ ft_handle_open(FT_HANDLE ft_h, const char *fname_in_env, int is_create, int only
...
@@ -3687,7 +3690,7 @@ ft_handle_open(FT_HANDLE ft_h, const char *fname_in_env, int is_create, int only
txn_created
=
(
bool
)(
txn
!=
NULL
);
txn_created
=
(
bool
)(
txn
!=
NULL
);
toku_logger_log_fcreate
(
txn
,
fname_in_env
,
reserved_filenum
,
mode
,
ft_h
->
options
.
flags
,
ft_h
->
options
.
nodesize
,
ft_h
->
options
.
basementnodesize
,
ft_h
->
options
.
compression_method
);
toku_logger_log_fcreate
(
txn
,
fname_in_env
,
reserved_filenum
,
mode
,
ft_h
->
options
.
flags
,
ft_h
->
options
.
nodesize
,
ft_h
->
options
.
basementnodesize
,
ft_h
->
options
.
compression_method
);
r
=
ft_create_file
(
ft_h
,
fname_in_cwd
,
&
fd
);
r
=
ft_create_file
(
ft_h
,
fname_in_cwd
,
&
fd
);
assert_zero
(
r
);
if
(
r
)
{
goto
exit
;
}
}
}
if
(
r
)
{
goto
exit
;
}
if
(
r
)
{
goto
exit
;
}
r
=
toku_cachetable_openfd_with_filenum
(
&
cf
,
cachetable
,
fd
,
fname_in_env
,
reserved_filenum
);
r
=
toku_cachetable_openfd_with_filenum
(
&
cf
,
cachetable
,
fd
,
fname_in_env
,
reserved_filenum
);
...
...
ft/roll.cc
View file @
63bc7424
...
@@ -194,7 +194,6 @@ toku_rollback_fcreate (FILENUM filenum,
...
@@ -194,7 +194,6 @@ toku_rollback_fcreate (FILENUM filenum,
// is not an error, but a missing file outside of recovery is.
// is not an error, but a missing file outside of recovery is.
r
=
toku_cachefile_of_filenum
(
ct
,
filenum
,
&
cf
);
r
=
toku_cachefile_of_filenum
(
ct
,
filenum
,
&
cf
);
if
(
r
==
ENOENT
)
{
if
(
r
==
ENOENT
)
{
assert
(
txn
->
for_recovery
);
r
=
0
;
r
=
0
;
goto
done
;
goto
done
;
}
}
...
...
portability/portability.cc
View file @
63bc7424
...
@@ -133,6 +133,10 @@ PATENT RIGHTS GRANT:
...
@@ -133,6 +133,10 @@ PATENT RIGHTS GRANT:
int
int
toku_portability_init
(
void
)
{
toku_portability_init
(
void
)
{
int
r
=
toku_memory_startup
();
int
r
=
toku_memory_startup
();
if
(
r
==
0
)
{
uint64_t
hz
;
r
=
toku_os_get_processor_frequency
(
&
hz
);
}
return
r
;
return
r
;
}
}
...
@@ -368,30 +372,37 @@ toku_get_processor_frequency_sysctl(const char * const cmd, uint64_t *hzret) {
...
@@ -368,30 +372,37 @@ toku_get_processor_frequency_sysctl(const char * const cmd, uint64_t *hzret) {
if
(
!
fp
)
{
if
(
!
fp
)
{
r
=
EINVAL
;
// popen doesn't return anything useful in errno,
r
=
EINVAL
;
// popen doesn't return anything useful in errno,
// gotta pick something
// gotta pick something
goto
exit
;
}
r
=
fscanf
(
fp
,
"%"
SCNu64
,
hzret
);
if
(
r
!=
1
)
{
r
=
get_maybe_error_errno
();
}
else
{
}
else
{
r
=
0
;
r
=
fscanf
(
fp
,
"%"
SCNu64
,
hzret
);
if
(
r
!=
1
)
{
r
=
get_maybe_error_errno
();
}
else
{
r
=
0
;
}
pclose
(
fp
);
}
}
pclose
(
fp
);
exit:
return
r
;
return
r
;
}
}
int
static
uint64_t
toku_cached_hz
;
// cache the value of hz so that we avoid opening files to compute it later
int
toku_os_get_processor_frequency
(
uint64_t
*
hzret
)
{
toku_os_get_processor_frequency
(
uint64_t
*
hzret
)
{
int
r
;
int
r
;
r
=
toku_get_processor_frequency_sys
(
hzret
);
if
(
toku_cached_hz
)
{
if
(
r
!=
0
)
*
hzret
=
toku_cached_hz
;
r
=
toku_get_processor_frequency_cpuinfo
(
hzret
);
r
=
0
;
if
(
r
!=
0
)
}
else
{
r
=
toku_get_processor_frequency_sysctl
(
"sysctl -n hw.cpufrequency"
,
hzret
);
r
=
toku_get_processor_frequency_sys
(
hzret
);
if
(
r
!=
0
)
if
(
r
!=
0
)
r
=
toku_get_processor_frequency_sysctl
(
"sysctl -n machdep.tsc_freq"
,
hzret
);
r
=
toku_get_processor_frequency_cpuinfo
(
hzret
);
if
(
r
!=
0
)
r
=
toku_get_processor_frequency_sysctl
(
"sysctl -n hw.cpufrequency"
,
hzret
);
if
(
r
!=
0
)
r
=
toku_get_processor_frequency_sysctl
(
"sysctl -n machdep.tsc_freq"
,
hzret
);
if
(
r
==
0
)
toku_cached_hz
=
*
hzret
;
}
return
r
;
return
r
;
}
}
...
@@ -439,3 +450,10 @@ double tokutime_to_seconds(tokutime_t t) {
...
@@ -439,3 +450,10 @@ double tokutime_to_seconds(tokutime_t t) {
}
}
return
t
*
seconds_per_clock
;
return
t
*
seconds_per_clock
;
}
}
#include <toku_race_tools.h>
void
__attribute__
((
constructor
))
toku_portability_helgrind_ignore
(
void
);
void
toku_portability_helgrind_ignore
(
void
)
{
TOKU_VALGRIND_HG_DISABLE_CHECKING
(
&
toku_cached_hz
,
sizeof
toku_cached_hz
);
}
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