Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
picodata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
picodata
Commits
195ac023
Commit
195ac023
authored
11 months ago
by
Egor Ivkov
Committed by
Yaroslav Dynnikov
11 months ago
Browse files
Options
Downloads
Patches
Plain Diff
refactor: have separate params for raft_id and raft_gen in audit::init
(cherry picked from commit
466cecc5
)
parent
2e355be1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/audit.rs
+2
-9
2 additions, 9 deletions
src/audit.rs
src/lib.rs
+6
-1
6 additions, 1 deletion
src/lib.rs
with
8 additions
and
10 deletions
src/audit.rs
+
2
−
9
View file @
195ac023
...
...
@@ -386,20 +386,13 @@ macro_rules! audit(
/// Initialize audit log.
/// Unique id generation depends on the raft machine's state.
/// Note: `config` will be parsed by tarantool's core (see `say.c`).
pub
fn
init
(
config
:
&
str
,
raft_storage
:
&
RaftSpaceAccess
)
{
// Raft-related stuff should be ready at this point.
let
raft_id
=
raft_storage
.raft_id
()
.expect
(
"failed to get raft_id for audit log"
)
.expect
(
"found zero raft_id during audit log init"
);
let
gen
=
raft_storage
.gen
()
.expect
(
"failed to get gen for audit log"
);
pub
fn
init
(
config
:
&
str
,
raft_id
:
u64
,
raft_gen
:
u64
)
{
// Note: this'll only fail if the cell's already set (shouldn't be possible).
// SAFETY: this is the first time we access this variable, and it's
// always done from the main (TX) thread.
unsafe
{
CLOCK
.set
(
LogicalClock
::
new
(
raft_id
,
gen
))
.set
(
LogicalClock
::
new
(
raft_id
,
raft_
gen
))
.expect
(
"failed to initialize global audit event id generator"
);
}
...
...
This diff is collapsed.
Click to expand it.
src/lib.rs
+
6
−
1
View file @
195ac023
...
...
@@ -811,7 +811,12 @@ fn postjoin(
config
.validate_storage
(
&
storage
,
&
raft_storage
)
?
;
if
let
Some
(
config
)
=
&
config
.instance.audit
{
audit
::
init
(
config
,
&
raft_storage
);
let
raft_id
=
raft_storage
.raft_id
()
.expect
(
"failed to get raft_id for audit log"
)
.expect
(
"found zero raft_id during audit log init"
);
let
gen
=
raft_storage
.gen
()
.expect
(
"failed to get gen for audit log"
);
audit
::
init
(
config
,
raft_id
,
gen
);
}
if
let
Some
(
plugins
)
=
&
config
.instance.plugins
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment