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
6f0cee63
Commit
6f0cee63
authored
9 months ago
by
Kurdakov Alexander
Committed by
Alexander Kurdakov
9 months ago
Browse files
Options
Downloads
Patches
Plain Diff
feat: always persist default tier
parent
07d2cb8f
No related branches found
No related tags found
1 merge request
!1047
feat: always persist default tier
Pipeline
#41732
failed
9 months ago
Stage: test
Stage: stress-test
This commit is part of merge request
!1047
. Comments created here will be created in the context of that merge request.
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/config.rs
+7
-5
7 additions, 5 deletions
src/config.rs
test/int/test_config_file.py
+39
-0
39 additions, 0 deletions
test/int/test_config_file.py
with
46 additions
and
5 deletions
src/config.rs
+
7
−
5
Edit
View file @
6f0cee63
...
...
@@ -772,18 +772,20 @@ pub struct ClusterConfig {
impl
ClusterConfig
{
pub
fn
tiers
(
&
self
)
->
HashMap
<
String
,
Tier
>
{
if
self
.tiers
.is_empty
()
{
return
HashMap
::
from
([(
DEFAULT_TIER
.to_string
(),
let
mut
tier_defs
=
HashMap
::
with_capacity
(
self
.tiers
.len
());
let
contains_default_tier_definition
=
self
.tiers
.get
(
DEFAULT_TIER
)
.is_some
();
if
!
contains_default_tier_definition
{
tier_defs
.insert
(
DEFAULT_TIER
.into
(),
Tier
{
name
:
DEFAULT_TIER
.into
(),
replication_factor
:
self
.default_replication_factor
(),
can_vote
:
true
,
},
)]
);
);
}
let
mut
tier_defs
=
HashMap
::
with_capacity
(
self
.tiers
.len
());
for
(
name
,
info
)
in
&
self
.tiers
{
let
replication_factor
=
info
.replication_factor
...
...
This diff is collapsed.
Click to expand it.
test/int/test_config_file.py
+
39
−
0
Edit
View file @
6f0cee63
...
...
@@ -401,3 +401,42 @@ def test_picodata_default_config(cluster: Cluster):
i
.
start
()
i
.
wait_online
()
def
test_default_tier_without_default_replication_factor
(
cluster
:
Cluster
):
# default tier wasn't created only in case of explicit configuration file
cluster
.
set_config_file
(
yaml
=
"""
cluster:
cluster_id: test
tiers:
not_default:
"""
)
instance
=
cluster
.
add_instance
()
dql
=
instance
.
sudo_sql
(
'
select
"
replication_factor
"
from
"
_pico_tier
"
where
"
name
"
=
\'
default
\'
'
)
assert
dql
[
"
rows
"
][
0
][
0
]
==
1
def
test_default_tier_with_default_replication_factor
(
cluster
:
Cluster
):
# default tier wasn't created only in case of explicit configuration file
cluster
.
set_config_file
(
yaml
=
"""
cluster:
default_replication_factor: 3
cluster_id: test
tiers:
not_default:
"""
)
instance
=
cluster
.
add_instance
()
dql
=
instance
.
sudo_sql
(
'
select
"
replication_factor
"
from
"
_pico_tier
"
where
"
name
"
=
\'
default
\'
'
)
assert
dql
[
"
rows
"
][
0
][
0
]
==
3
This diff is collapsed.
Click to expand it.
Alexander Kurdakov
@kusancho
mentioned in commit
ea6a3b28
·
8 months ago
mentioned in commit
ea6a3b28
mentioned in commit ea6a3b286ca73afb6fcc27370ee50cb1c2134fce
Toggle commit list
Alexander Kurdakov
@kusancho
mentioned in commit
dc43fd0c
·
8 months ago
mentioned in commit
dc43fd0c
mentioned in commit dc43fd0c8804aeb0bbc8a7906a823b388b7be262
Toggle commit list
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