Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
tarantool
Commits
f612f59d
Commit
f612f59d
authored
9 years ago
by
Konstantin Osipov
Browse files
Options
Downloads
Patches
Plain Diff
gh-727: memtx proper rollback in case of out of memory, add comments
parent
19b08646
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/box/memtx_engine.cc
+12
-1
12 additions, 1 deletion
src/box/memtx_engine.cc
with
12 additions
and
1 deletion
src/box/memtx_engine.cc
+
12
−
1
View file @
f612f59d
...
@@ -58,6 +58,13 @@ static bool memtx_index_arena_initialized = false;
...
@@ -58,6 +58,13 @@ static bool memtx_index_arena_initialized = false;
static
struct
slab_arena
memtx_index_arena
;
static
struct
slab_arena
memtx_index_arena
;
static
struct
slab_cache
memtx_index_arena_slab_cache
;
static
struct
slab_cache
memtx_index_arena_slab_cache
;
static
struct
mempool
memtx_index_extent_pool
;
static
struct
mempool
memtx_index_extent_pool
;
/**
* To ensure proper statement-level rollback in case
* of out of memory conditions, we maintain a number
* of slack memory extents reserved before a statement
* is begun. If there isn't enough slack memory,
* we don't begin the statement.
*/
static
int
memtx_index_num_reserved_extents
;
static
int
memtx_index_num_reserved_extents
;
static
void
*
memtx_index_reserved_extents
;
static
void
*
memtx_index_reserved_extents
;
...
@@ -164,6 +171,10 @@ memtx_replace_all_keys(struct txn *txn, struct space *space,
...
@@ -164,6 +171,10 @@ memtx_replace_all_keys(struct txn *txn, struct space *space,
struct
tuple
*
old_tuple
,
struct
tuple
*
new_tuple
,
struct
tuple
*
old_tuple
,
struct
tuple
*
new_tuple
,
enum
dup_replace_mode
mode
)
enum
dup_replace_mode
mode
)
{
{
/*
* Ensure we have enough slack memory to guarantee
* successful statement-level rollback.
*/
memtx_index_extent_reserve
(
RESERVE_EXTENTS_BEFORE_REPLACE
);
memtx_index_extent_reserve
(
RESERVE_EXTENTS_BEFORE_REPLACE
);
uint32_t
i
=
0
;
uint32_t
i
=
0
;
try
{
try
{
...
@@ -891,4 +902,4 @@ memtx_index_extent_reserve(int num)
...
@@ -891,4 +902,4 @@ memtx_index_extent_reserve(int num)
memtx_index_reserved_extents
=
ext
;
memtx_index_reserved_extents
=
ext
;
memtx_index_num_reserved_extents
++
;
memtx_index_num_reserved_extents
++
;
}
}
}
}
\ No newline at end of file
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