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
4e9d64ea
Commit
4e9d64ea
authored
1 year ago
by
Georgy Moshkin
Browse files
Options
Downloads
Patches
Plain Diff
fix: guard against read-onlyness in proc_apply_schema_change
parent
94086784
No related branches found
No related tags found
1 merge request
!570
Fix/unfinished ddl by snapshot
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/rpc/ddl_apply.rs
+9
-1
9 additions, 1 deletion
src/rpc/ddl_apply.rs
src/traft/error.rs
+6
-0
6 additions, 0 deletions
src/traft/error.rs
with
15 additions
and
1 deletion
src/rpc/ddl_apply.rs
+
9
−
1
View file @
4e9d64ea
...
...
@@ -7,7 +7,7 @@ use crate::traft::node;
use
crate
::
traft
::
Result
;
use
crate
::
traft
::{
RaftIndex
,
RaftTerm
};
use
std
::
time
::
Duration
;
use
tarantool
::
error
::
TarantoolError
;
use
tarantool
::
error
::
{
TarantoolError
,
TarantoolErrorCode
}
;
use
tarantool
::
ffi
::
tarantool
as
ffi
;
use
tarantool
::
space
::{
Space
,
SystemSpace
};
...
...
@@ -25,6 +25,14 @@ crate::define_rpc_request! {
return
Ok
(
Response
::
Ok
);
}
if
crate
::
tarantool
::
eval
(
"return box.info.ro"
)
?
{
let
e
=
tarantool
::
set_and_get_error!
(
TarantoolErrorCode
::
Readonly
,
"cannot apply schema change on a read only instance"
);
return
Err
(
e
.into
());
}
let
ddl
=
storage
.properties
.pending_schema_change
()
?
.ok_or_else
(||
Error
::
other
(
"pending schema change not found"
))
?
;
// FIXME: start_transaction api is awful, it would be too ugly to
...
...
This diff is collapsed.
Click to expand it.
src/traft/error.rs
+
6
−
0
View file @
4e9d64ea
...
...
@@ -104,6 +104,12 @@ impl From<::tarantool::error::TransactionError> for Error {
}
}
impl
From
<
::
tarantool
::
error
::
TarantoolError
>
for
Error
{
fn
from
(
err
:
::
tarantool
::
error
::
TarantoolError
)
->
Self
{
Self
::
Tarantool
(
err
.into
())
}
}
#[derive(Debug,
Error)]
pub
enum
CoercionError
{
#[error(
"unknown entry type ({0})"
)]
...
...
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