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
a4aa095c
Commit
a4aa095c
authored
1 year ago
by
Georgy Moshkin
Browse files
Options
Downloads
Patches
Plain Diff
fix: vshard used to break box.cfg.listen value
parent
f9620f09
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!869
fix: vshard used to break box.cfg.listen value
Pipeline
#32814
passed
1 year ago
Stage: test
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/rpc/sharding.rs
+4
-3
4 additions, 3 deletions
src/rpc/sharding.rs
src/vshard.rs
+8
-0
8 additions, 0 deletions
src/vshard.rs
with
12 additions
and
3 deletions
src/rpc/sharding.rs
+
4
−
3
View file @
a4aa095c
...
@@ -22,11 +22,12 @@ crate::define_rpc_request! {
...
@@ -22,11 +22,12 @@ crate::define_rpc_request! {
node
.wait_index
(
req
.applied
,
req
.timeout
)
?
;
node
.wait_index
(
req
.applied
,
req
.timeout
)
?
;
node
.status
()
.check_term
(
req
.term
)
?
;
node
.status
()
.check_term
(
req
.term
)
?
;
let
cfg
=
node
.storage.properties
.target_vshard_config
()
?
;
crate
::
tlog!
(
Debug
,
"vshard config: {cfg:?}"
);
let
lua
=
::
tarantool
::
lua_state
();
let
lua
=
::
tarantool
::
lua_state
();
let
mut
cfg
=
node
.storage.properties
.target_vshard_config
()
?
;
cfg
.listen
=
Some
(
lua
.eval
(
"return box.info.listen"
)
?
);
crate
::
tlog!
(
Debug
,
"vshard config: {cfg:?}"
);
if
!
req
.do_reconfigure
{
if
!
req
.do_reconfigure
{
if
let
Some
(
tlua
::
True
)
=
lua
.eval
(
"return pico._vshard_is_configured"
)
?
{
if
let
Some
(
tlua
::
True
)
=
lua
.eval
(
"return pico._vshard_is_configured"
)
?
{
return
Ok
(
Response
{});
return
Ok
(
Response
{});
...
...
This diff is collapsed.
Click to expand it.
src/vshard.rs
+
8
−
0
View file @
a4aa095c
...
@@ -14,6 +14,13 @@ use std::collections::HashMap;
...
@@ -14,6 +14,13 @@ use std::collections::HashMap;
pub
struct
VshardConfig
{
pub
struct
VshardConfig
{
sharding
:
HashMap
<
String
,
ReplicasetSpec
>
,
sharding
:
HashMap
<
String
,
ReplicasetSpec
>
,
discovery_mode
:
DiscoveryMode
,
discovery_mode
:
DiscoveryMode
,
/// This field is not stored in the global storage, instead
/// it is set right before the config is passed into vshard.*.cfg,
/// otherwise vshard will override it with an incorrect value.
#[serde(skip_serializing_if=
"Option::is_none"
)]
#[serde(default)]
pub
listen
:
Option
<
String
>
,
}
}
#[rustfmt::skip]
#[rustfmt::skip]
...
@@ -110,6 +117,7 @@ impl VshardConfig {
...
@@ -110,6 +117,7 @@ impl VshardConfig {
}
}
Self
{
Self
{
listen
:
None
,
sharding
,
sharding
,
discovery_mode
:
DiscoveryMode
::
On
,
discovery_mode
:
DiscoveryMode
::
On
,
}
}
...
...
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