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
d2220654
Commit
d2220654
authored
1 year ago
by
Georgy Moshkin
Browse files
Options
Downloads
Patches
Plain Diff
refactor: make it more obvious when read_index times out
parent
32accbd9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!573
Implement basic ACL functions
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/schema.rs
+9
-7
9 additions, 7 deletions
src/schema.rs
with
9 additions
and
7 deletions
src/schema.rs
+
9
−
7
View file @
d2220654
...
...
@@ -15,12 +15,12 @@ use tarantool::{
};
use
serde
::{
Deserialize
,
Serialize
};
use
thiserror
::
Error
;
use
crate
::
cas
::{
self
,
compare_and_swap
};
use
crate
::
storage
::
ToEntryIter
;
use
crate
::
storage
::
SPACE_ID_INTERNAL_MAX
;
use
crate
::
storage
::{
Clusterwide
,
ClusterwideSpaceId
,
PropertyName
};
use
crate
::
traft
::
error
::
Error
;
use
crate
::
traft
::
op
::{
Ddl
,
Op
};
use
crate
::
traft
::{
self
,
event
,
node
,
RaftIndex
};
use
crate
::
util
::
instant_saturating_add
;
...
...
@@ -252,7 +252,7 @@ pub fn try_space_field_type_to_index_field_type(
res
}
#[derive(Debug,
Error)]
#[derive(Debug,
thiserror::
Error)]
pub
enum
DdlError
{
#[error(
"space creation failed: {0}"
)]
CreateSpace
(
#[from]
CreateSpaceError
),
...
...
@@ -262,7 +262,7 @@ pub enum DdlError {
NoPendingDdl
,
}
#[derive(Debug,
Error)]
#[derive(Debug,
thiserror::
Error)]
pub
enum
CreateSpaceError
{
#[error(
"space with id {0} already exists"
)]
IdExists
(
SpaceId
),
...
...
@@ -278,7 +278,7 @@ pub enum CreateSpaceError {
ConflictingShardingPolicy
,
}
impl
From
<
CreateSpaceError
>
for
traft
::
error
::
Error
{
impl
From
<
CreateSpaceError
>
for
Error
{
fn
from
(
err
:
CreateSpaceError
)
->
Self
{
DdlError
::
CreateSpace
(
err
)
.into
()
}
...
...
@@ -555,7 +555,7 @@ pub fn wait_for_ddl_commit(
if
let
Some
(
timeout
)
=
deadline
.checked_duration_since
(
Instant
::
now
())
{
event
::
wait_timeout
(
event
::
Event
::
EntryApplied
,
timeout
)
?
;
}
else
{
return
Err
(
traft
::
error
::
Error
::
Timeout
);
return
Err
(
Error
::
Timeout
);
}
}
}
...
...
@@ -576,7 +576,7 @@ fn wait_for_no_pending_schema_change(
if
let
Some
(
timeout
)
=
deadline
.checked_duration_since
(
Instant
::
now
())
{
event
::
wait_timeout
(
event
::
Event
::
EntryApplied
,
timeout
)
?
;
}
else
{
return
Err
(
traft
::
error
::
Error
::
Timeout
);
return
Err
(
Error
::
Timeout
);
}
}
}
...
...
@@ -597,7 +597,9 @@ pub fn prepare_schema_change(op: Op, timeout: Duration) -> traft::Result<RaftInd
let
mut
op
=
op
.clone
();
op
.set_schema_version
(
storage
.properties
.next_schema_version
()
?
);
wait_for_no_pending_schema_change
(
storage
,
timeout
)
?
;
let
index
=
node
::
global
()
?
.read_index
(
timeout
)
?
;
let
index
=
node
::
global
()
?
.read_index
(
timeout
)
.map_err
(|
e
|
Error
::
other
(
format!
(
"read_index failed: {e}"
)))
?
;
let
term
=
raft
::
Storage
::
term
(
raft_storage
,
index
)
?
;
let
predicate
=
cas
::
Predicate
{
index
,
...
...
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