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
afed17dc
Commit
afed17dc
authored
4 months ago
by
Georgy Moshkin
Browse files
Options
Downloads
Patches
Plain Diff
chore: add some logging when joining and updating instances
parent
d513eae3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1399
Gmoshkin/fix join after expel
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/rpc/join.rs
+5
-1
5 additions, 1 deletion
src/rpc/join.rs
src/rpc/update_instance.rs
+5
-1
5 additions, 1 deletion
src/rpc/update_instance.rs
with
10 additions
and
2 deletions
src/rpc/join.rs
+
5
−
1
View file @
afed17dc
...
...
@@ -10,6 +10,7 @@ use crate::schema::ADMIN_ID;
use
crate
::
storage
::
ClusterwideTable
;
use
crate
::
storage
::{
Clusterwide
,
ToEntryIter
as
_
};
use
crate
::
tier
::
Tier
;
use
crate
::
tlog
;
use
crate
::
traft
::
op
::{
Dml
,
Op
};
use
crate
::
traft
::{
self
,
RaftId
};
use
crate
::
traft
::{
error
::
Error
,
node
,
Address
,
PeerAddress
,
Result
};
...
...
@@ -33,7 +34,10 @@ crate::define_rpc_request! {
/// 4. Compare and swap request to commit new instance and its address failed
/// with an error that cannot be retried.
fn
proc_raft_join
(
req
:
Request
)
->
Result
<
Response
>
{
handle_join_request_and_wait
(
req
,
TIMEOUT
)
let
res
=
handle_join_request_and_wait
(
req
,
TIMEOUT
)
?
;
tlog!
(
Info
,
"new instance joined the cluster: {:?}"
,
res
.instance
);
Ok
(
res
)
}
/// Request to join the cluster.
...
...
This diff is collapsed.
Click to expand it.
src/rpc/update_instance.rs
+
5
−
1
View file @
afed17dc
...
...
@@ -9,6 +9,7 @@ use crate::replicaset::Replicaset;
use
crate
::
schema
::
ADMIN_ID
;
use
crate
::
storage
::
ClusterwideTable
;
use
crate
::
tier
::
Tier
;
use
crate
::
tlog
;
use
crate
::
traft
::
op
::{
Dml
,
Op
};
use
crate
::
traft
::
Result
;
use
crate
::
traft
::{
error
::
Error
,
node
};
...
...
@@ -35,8 +36,11 @@ crate::define_rpc_request! {
/// with an error that cannot be retried.
fn
proc_update_instance
(
req
:
Request
)
->
Result
<
Response
>
{
if
req
.current_state
.is_some
()
{
return
Err
(
Error
::
Other
(
"Changing current state through Proc API is not allowed."
.into
()));
tlog!
(
Warning
,
"invalid request to update current state: {req:?}"
);
return
Err
(
Error
::
Other
(
"Changing current state through Proc API is not allowed."
.into
()));
}
tlog!
(
Debug
,
"got update instance request: {req:?}"
);
handle_update_instance_request_and_wait
(
req
,
TIMEOUT
)
?
;
Ok
(
Response
{})
}
...
...
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