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
15fcc7c0
Commit
15fcc7c0
authored
12 years ago
by
pcherenkov
Browse files
Options
Downloads
Plain Diff
Merge branch 'wal-doc' into doc-edit-1
parents
b0ac629f
ea32bf31
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/user/persistence-architecture.xml
+23
-25
23 additions, 25 deletions
doc/user/persistence-architecture.xml
with
23 additions
and
25 deletions
doc/user/persistence-architecture.xml
+
23
−
25
View file @
15fcc7c0
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<title>
Data persistence
</title>
<title>
Data persistence
</title>
<para>
<para>
To maintain data persistence, Tarantool writes each data change
To maintain data persistence, Tarantool writes each data change
request (INSERT, UPDATE, DELETE) into a write
ahead log. WAL
request (INSERT, UPDATE, DELETE) into a write
-
ahead log. WAL
files have extension
<filename>
.xlog
</filename>
and are stored in
<olink
files have extension
<filename>
.xlog
</filename>
and are stored in
<olink
targetptr=
"wal_dir"
/>
. A new WAL file is created for every
<olink
targetptr=
"wal_dir"
/>
. A new WAL file is created for every
<olink
targetptr=
"rows_per_wal"
/>
records. Each INSERT, UPDATE or DELETE
targetptr=
"rows_per_wal"
/>
records. Each INSERT, UPDATE or DELETE
...
@@ -23,36 +23,35 @@ each WAL record contains a checksum and a UNIX time stamp.
...
@@ -23,36 +23,35 @@ each WAL record contains a checksum and a UNIX time stamp.
</para>
</para>
<para>
<para>
Tarantool procee
d
s requests atomically: a change is either
Tarantool proce
ss
es requests atomically: a change is either
accepted and recorded in the WAL, or is
rejected wholesale
.
accepted and recorded in the WAL, or
d
is
carded completely
.
Let's clarify how this happens, using REPLACE command as an
Let's clarify how this happens, using REPLACE command as an
example:
example:
<orderedlist>
<orderedlist>
<listitem><para>
<listitem><para>
The server
trie
s to locate
an old tuple identified
by
The server
attempt
s to locate
the original tuple
by
the same
primary key. If found, the tuple is re
membered for
primary key. If found,
a reference to
the tuple is re
tained
later.
for
later
use
.
</para></listitem>
</para></listitem>
<listitem><para>
<listitem><para>
The new tuple is
<emphasis>
validated
</emphasis>
. If it
The new tuple is
then
<emphasis>
validated
</emphasis>
. If it
violates a
ny of the
unique
key constraint
s
, misses
violates a unique
-
key constraint, misses
an
y of
indexed field
s
, or an index
ed
field type does not
an indexed field, or an index
-
field type does not
match index
type
, the change is aborted.
match
the type of the
index, the change is aborted.
</para></listitem>
</para></listitem>
<listitem><para>
<listitem><para>
The new tuple is marked 'invisible' and is added to
The new tuple is marked 'invisible' and is added to
the primary and secondary indexes.
the primary and secondary indexes.
</para></listitem>
</para></listitem>
<listitem><para>
<listitem><para>
A message is sent to a separate
<quote>
wal_writer
</quote>
A message is sent to
<quote>
wal_writer
</quote>
, running in a
thread requesting that the change is recorded in the WAL.
separate thread, requesting that the change be recorded in the WAL.
The fiber associate with the current connection is scheduled
The fiber associated with the current connection is suspended
off CPU until an acknowledgment is received from the WAL
until an acknowledgment from the WAL writer.
writer.
</para></listitem>
</para></listitem>
<listitem><para>
<listitem><para>
Upon success, 'invisible' flag is cleared
Upon success,
the
'invisible' flag is cleared
and the ol
d
tuple is deleted. A response is sent to the
and the o
rigina
l tuple is deleted. A response is sent to the
client. Upon failure, the new tuple is removed and
<olink
client. Upon failure, the new tuple is removed and
<olink
targetptr=
"ER_WAL_IO"
/>
error is sent to the client.
targetptr=
"ER_WAL_IO"
/>
error is sent to the client.
</para></listitem>
</para></listitem>
...
@@ -60,13 +59,12 @@ example:
...
@@ -60,13 +59,12 @@ example:
</para>
</para>
<para>
<para>
Communication between master and WAL writer threads is asynchronous.
The master and the WAL writer threads communicate using asynchronous (yet reliable)
It is implemented using an asynchronous FIFO queue.
messaging; the master theread, not being blocked on
Asynchronous but reliable message passing between the master
WAL tasks, continues to handle requests quickly
and WAL writer threads allows Tarantool to continue handling
even at hight volumes of disk I/O. For instance, SELECT performance,
requests regardless of disk throughput. SELECT performance,
provided SELECTs are run in their own connections, remains
provided SELECTs are run in their own connections, is unaffected
unaffected by disk load.
by disk load.
</para>
</para>
<para>
<para>
...
...
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