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
f7b5a318
Commit
f7b5a318
authored
1 year ago
by
Georgy Moshkin
Browse files
Options
Downloads
Patches
Plain Diff
fix: used to panic when computing distant deadlines
parent
9485e9c1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!565
fix: used to panic when computing deadlines
Pipeline
#19246
failed
1 year ago
Stage: test
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/rpc/sync.rs
+2
-1
2 additions, 1 deletion
src/rpc/sync.rs
src/schema.rs
+3
-2
3 additions, 2 deletions
src/schema.rs
with
5 additions
and
3 deletions
src/rpc/sync.rs
+
2
−
1
View file @
f7b5a318
use
crate
::
tlog
;
use
crate
::
traft
::
Result
;
use
crate
::
traft
::{
error
::
Error
,
event
,
node
,
RaftIndex
,
RaftSpaceAccess
};
use
crate
::
util
::
instant_saturating_add
;
use
std
::
time
::{
Duration
,
Instant
};
...
...
@@ -28,7 +29,7 @@ pub fn wait_for_index_timeout(
raft_storage
:
&
RaftSpaceAccess
,
timeout
:
Duration
,
)
->
Result
<
RaftIndex
>
{
let
deadline
=
Instant
::
now
()
+
timeout
;
let
deadline
=
instant_saturating_add
(
Instant
::
now
()
,
timeout
)
;
loop
{
let
cur_applied
=
raft_storage
.applied
()
?
.unwrap_or
(
0
);
if
cur_applied
>=
applied
{
...
...
This diff is collapsed.
Click to expand it.
src/schema.rs
+
3
−
2
View file @
f7b5a318
...
...
@@ -24,6 +24,7 @@ use crate::storage::SPACE_ID_INTERNAL_MAX;
use
crate
::
storage
::{
set_local_schema_version
,
Clusterwide
,
ClusterwideSpaceId
,
PropertyName
};
use
crate
::
traft
::
op
::{
Ddl
,
DdlBuilder
,
Op
};
use
crate
::
traft
::{
self
,
event
,
node
,
RaftIndex
};
use
crate
::
util
::
instant_saturating_add
;
/// Space definition.
///
...
...
@@ -435,7 +436,7 @@ pub fn wait_for_ddl_commit(
timeout
:
Duration
,
)
->
traft
::
Result
<
RaftIndex
>
{
let
raft_storage
=
&
node
::
global
()
?
.raft_storage
;
let
deadline
=
Instant
::
now
()
+
timeout
;
let
deadline
=
instant_saturating_add
(
Instant
::
now
()
,
timeout
)
;
let
last_seen
=
prepare_commit
;
loop
{
let
cur_applied
=
raft_storage
.applied
()
?
.expect
(
"commit is always persisted"
);
...
...
@@ -468,7 +469,7 @@ fn wait_for_no_pending_schema_change(
storage
:
&
Clusterwide
,
timeout
:
Duration
,
)
->
traft
::
Result
<
()
>
{
let
deadline
=
Instant
::
now
()
+
timeout
;
let
deadline
=
instant_saturating_add
(
Instant
::
now
()
,
timeout
)
;
loop
{
if
storage
.properties
.pending_schema_change
()
?
.is_none
()
{
return
Ok
(());
...
...
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