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
d92313de
Commit
d92313de
authored
1 year ago
by
Georgy Moshkin
Browse files
Options
Downloads
Patches
Plain Diff
fix: used to send incorrect snapshot version when reusing the read view
parent
3089e6e3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!734
fix: used to send incorrect snapshot version when reusing the read view
Pipeline
#27364
failed
1 year ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/storage.rs
+8
-5
8 additions, 5 deletions
src/storage.rs
src/traft/node.rs
+1
-0
1 addition, 0 deletions
src/traft/node.rs
with
9 additions
and
5 deletions
src/storage.rs
+
8
−
5
View file @
d92313de
...
...
@@ -402,9 +402,12 @@ impl Clusterwide {
space_indexes
.push
((
space_def
.id
,
0
));
}
let
schema_version
=
self
.properties
.global_schema_version
()
?
;
let
read_view
=
ReadView
::
for_space_indexes
(
space_indexes
)
?
;
Ok
(
SnapshotReadView
{
entry_id
,
schema_version
,
time_opened
:
fiber
::
clock
(),
unfinished_iterators
:
Default
::
default
(),
read_view
,
...
...
@@ -520,9 +523,7 @@ impl Clusterwide {
);
let
snapshot_data
=
SnapshotData
{
// Only the first chunk contains the schema_version, after that
// there's no need for it.
schema_version
:
u64
::
MAX
,
schema_version
:
rv
.schema_version
,
space_dumps
,
next_chunk_position
:
hit_threashold
.then_some
(
position
),
};
...
...
@@ -583,8 +584,7 @@ impl Clusterwide {
let
mut
rv
=
self
.open_read_view
(
entry_id
)
?
;
tlog!
(
Info
,
"opened snapshot read view for {entry_id}"
);
let
position
=
SnapshotPosition
::
default
();
let
mut
snapshot_data
=
self
.next_snapshot_data_chunk_impl
(
&
mut
rv
,
position
)
?
;
snapshot_data
.schema_version
=
self
.properties
.global_schema_version
()
?
;
let
snapshot_data
=
self
.next_snapshot_data_chunk_impl
(
&
mut
rv
,
position
)
?
;
if
snapshot_data
.next_chunk_position
.is_none
()
{
// Don't increase the reference count, so that it's cleaned up next
...
...
@@ -1777,6 +1777,9 @@ pub struct SnapshotReadView {
/// Applied entry id at the time the read view was opened.
entry_id
:
RaftEntryId
,
/// Global schema version at the moment of read view openning.
schema_version
:
u64
,
/// [`fiber::clock()`] value at the moment snapshot read view was opened.
/// Can be used to close stale read views with dangling references, which
/// may occur if followers drop off during chunkwise snapshot application.
...
...
This diff is collapsed.
Click to expand it.
src/traft/node.rs
+
1
−
0
View file @
d92313de
...
...
@@ -1421,6 +1421,7 @@ impl NodeImpl {
return
Some
(
snapshot_data
);
}
tlog!
(
Debug
,
"v_local: {v_local}, v_snapshot: {v_snapshot}"
);
self
.main_loop_status
(
"awaiting replication"
);
// Replicaset follower needs to sync with leader via tarantool
// replication.
...
...
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