Branch: refs/heads/doc-edit-1
Home: https://github.com/mailru/tarantool
Commit: cc0868ea41576c034bde9a30bfa16d9ab5006d8a
https://github.com/mailru/tarantool/commit/cc0868ea41576c034bde9a30bfa16d9ab5006d8a
Author: pcherenkov <[email protected]>
Date: 2012-05-03 (Thu, 03 May 2012)
Changed paths:
M doc/user/configuration-reference.xml
M doc/user/persistence-architecture.xml
Log Message:
-----------
bug988508: wal_mode documented
diff --git a/doc/user/configuration-reference.xml
b/doc/user/configuration-reference.xml
index 4bbb6a7..fe6b555 100644
--- a/doc/user/configuration-reference.xml
+++ b/doc/user/configuration-reference.xml
@@ -547,6 +547,22 @@ tarantool_box: primary@sessions pri:33013 sec:33014
adm:33015</programlisting>
recovery.</entry>
</row>
+ <row>
+ <entry xml:id="wal_mode" xreflabel="wal_mode">wal_mode</entry>
+ <entry>string</entry>
+ <entry>"fsync_delay"</entry>
+ <entry>no</entry>
+ <entry>yes</entry>
+ <entry>Specify fiber-WAL-disk synchronization mode as:
+ <emphasis>write:</emphasis> fibers wait for their data to
+ be written to WAL (no fsync(2)); <emphasis>fsync</emphasis>:
+ fibers wait for their data, fsync(2) follows each write(2);
+ <emphasis>fsync_delay</emphasis>: fibers wait for their
+ data, fsync(2) is called every
N=<emphasis>wal_fsync_delay</emphasis>
+ seconds (N=0.0 means no fsync(2) - equivalent to
+ <emphasis>wal_mode = "write"</emphasis>);</entry>
+ </row>
+
</tbody>
</tgroup>
</table>
diff --git a/doc/user/persistence-architecture.xml
b/doc/user/persistence-architecture.xml
index d9f51dd..e1c3aa7 100644
--- a/doc/user/persistence-architecture.xml
+++ b/doc/user/persistence-architecture.xml
@@ -70,42 +70,11 @@ by disk load.
</para>
<para>
-WAL writer ensures data consistency and synchronization
-between requesting fibers, WAL writer and disk by
-employing one the following modes of operation (designated by
-<emphasis>wal_mode</emphasis> and
-<emphasis>wal_fsync_delay</emphasis> configuration keys):
-<orderedlist>
- <listitem><para><emphasis>write</emphasis>: fibers wait for their
- data to be written to the log (no fsync(2));</para></listitem>
- <listitem><para><emphasis>fsync</emphasis>: fibers wait for their
- data, fsync(2) follows each write(2);</para></listitem>
- <listitem><para><emphasis>fsync_delay</emphasis>: fibers wait for their
- data, fsync every N=<emphasis>wal_fsync_delay</emphasis>
- seconds (N=0.0 means no fsync(2) - equivalent to
- <emphasis>wal_mode = "write"</emphasis>);</para></listitem>
-</orderedlist>
+WAL writer employs a number of modes for synchronization between
+requesting fibers, WAL writer and disk hardware, as defined
+in configuration for <olink targetptr="wal_mode"/>.
</para>
-<!--
-<para>
-WAL writer ensures data consistency and synchronization
-between requesting fibers, WAL writer and disk by
-employing one the following modes of operation (designated by
-<emphasis>wal_mode</emphasis> and
-<emphasis>wal_fsync_delay</emphasis> configuration keys):
-<orderedlist>
- <listitem><emphasis>write</emphasis>: fibers wait for their
- data to be written to the log (no fsync(2));</listitem>
- <listitem><emphasis>fsync</emphasis>: fibers wait for their
- data, fsync(2) follows each write(2);</listitem>
- <listitem><emphasis>fsync_delay</emphasis>: fibers wait for their
- data, fsync every N=<emphasis>wal_fsync_delay</emphasis>
- seconds (N=0.0 means no fsync(2) - equivalent to
- <emphasis>wal_mode = "write"</emphasis>);</listitem>
-</orderedlist>
-</para>
--->
</section>
<!--
================================================================
Commit: 620d90b39152fe762b45029861fbafdeedc842a9
https://github.com/mailru/tarantool/commit/620d90b39152fe762b45029861fbafdeedc842a9
Author: pcherenkov <[email protected]>
Date: 2012-05-03 (Thu, 03 May 2012)
Changed paths:
M doc/user/configuration-reference.xml
M doc/user/stored-programs.xml
Log Message:
-----------
bug923715: init.lua documented
diff --git a/doc/user/configuration-reference.xml
b/doc/user/configuration-reference.xml
index 4bbb6a7..91b8b62 100644
--- a/doc/user/configuration-reference.xml
+++ b/doc/user/configuration-reference.xml
@@ -259,7 +259,7 @@ lsn:4 tm:1301572313.691 t:65534 127.0.0.1:52728
UPDATE_FIELDS n:0flags:00000000
</row>
<row>
- <entry>work_dir</entry>
+ <entry xml:id="work_dir" xreflabel="work_dir">work_dir</entry>
<entry>string</entry>
<entry>""</entry>
<entry>no</entry>
diff --git a/doc/user/stored-programs.xml b/doc/user/stored-programs.xml
index 39c59ee..c668378 100644
--- a/doc/user/stored-programs.xml
+++ b/doc/user/stored-programs.xml
@@ -20,7 +20,7 @@
</para>
</blockquote>
<para>
- Procedures can be invoked both from the administrative
+ Procedures can be invoked from the administrative
console and using the binary protocol, for example:
<programlisting><computeroutput>localhost> lua function f1() return 'hello' end
---
@@ -58,6 +58,43 @@ localhost> lua "hello".." world"
</computeroutput></programlisting>
</para>
<para>
+ Lua procedures could also be called at the time of initialization
+ using a dedicated <emphasis>init.lua</emphasis> script,
+ located in <olink targetptr="work_dir" />.
+
+ An example of such a script is given below:
+ <programlisting>
+ <![CDATA[
+-- Importing expirationd module
+dofile("expirationd.lua")
+
+function is_expired(args, tuple)
+ if tuple == nil then
+ return true
+ end
+
+ if #tuple <= args.field_no then
+ return true
+ end
+
+ field = tuple[args.field_no]
+ if field == nil or #field ~= 4 then
+ return true
+ end
+
+ local current_time = os.time()
+ local tuple_ts = box.unpack("i", field)
+ return current_time >= tuple_ts + args.ttl
+end
+
+-- Run task
+expirationd.run_task("exprd space 0", 0, is_expired, nil,
+ { field_no = 1, ttl = 30 * 60 })
+]]>
+ </programlisting>
+ </para>
+
+ <para>
There is a single global instance of Lua interpreter, which is
shared across all connections. Anything prefixed with
<code>lua </code> on the administrative console is sent
================================================================
Commit: a1d666fda3f4a338be62cd6e0461b01e323512a1
https://github.com/mailru/tarantool/commit/a1d666fda3f4a338be62cd6e0461b01e323512a1
Author: pcherenkov <[email protected]>
Date: 2012-05-03 (Thu, 03 May 2012)
Changed paths:
M doc/user/configuration-reference.xml
M doc/user/persistence-architecture.xml
M doc/user/stored-programs.xml
Log Message:
-----------
Merge branch 'bug923715'
diff --git a/doc/user/configuration-reference.xml
b/doc/user/configuration-reference.xml
index 9a24ca6..9f60c14 100644
--- a/doc/user/configuration-reference.xml
+++ b/doc/user/configuration-reference.xml
@@ -259,7 +259,7 @@ lsn:4 tm:1301572313.691 t:65534 127.0.0.1:52728
UPDATE_FIELDS n:0flags:00000000
</row>
<row>
- <entry>work_dir</entry>
+ <entry xml:id="work_dir" xreflabel="work_dir">work_dir</entry>
<entry>string</entry>
<entry>""</entry>
<entry>no</entry>
diff --git a/doc/user/persistence-architecture.xml
b/doc/user/persistence-architecture.xml
index 5db4d1f..d9f51dd 100644
--- a/doc/user/persistence-architecture.xml
+++ b/doc/user/persistence-architecture.xml
@@ -69,6 +69,44 @@ provided SELECTs are run in their own connections, is
unaffected
by disk load.
</para>
+<para>
+WAL writer ensures data consistency and synchronization
+between requesting fibers, WAL writer and disk by
+employing one the following modes of operation (designated by
+<emphasis>wal_mode</emphasis> and
+<emphasis>wal_fsync_delay</emphasis> configuration keys):
+<orderedlist>
+ <listitem><para><emphasis>write</emphasis>: fibers wait for their
+ data to be written to the log (no fsync(2));</para></listitem>
+ <listitem><para><emphasis>fsync</emphasis>: fibers wait for their
+ data, fsync(2) follows each write(2);</para></listitem>
+ <listitem><para><emphasis>fsync_delay</emphasis>: fibers wait for their
+ data, fsync every N=<emphasis>wal_fsync_delay</emphasis>
+ seconds (N=0.0 means no fsync(2) - equivalent to
+ <emphasis>wal_mode = "write"</emphasis>);</para></listitem>
+</orderedlist>
+</para>
+
+<!--
+<para>
+WAL writer ensures data consistency and synchronization
+between requesting fibers, WAL writer and disk by
+employing one the following modes of operation (designated by
+<emphasis>wal_mode</emphasis> and
+<emphasis>wal_fsync_delay</emphasis> configuration keys):
+<orderedlist>
+ <listitem><emphasis>write</emphasis>: fibers wait for their
+ data to be written to the log (no fsync(2));</listitem>
+ <listitem><emphasis>fsync</emphasis>: fibers wait for their
+ data, fsync(2) follows each write(2);</listitem>
+ <listitem><emphasis>fsync_delay</emphasis>: fibers wait for their
+ data, fsync every N=<emphasis>wal_fsync_delay</emphasis>
+ seconds (N=0.0 means no fsync(2) - equivalent to
+ <emphasis>wal_mode = "write"</emphasis>);</listitem>
+</orderedlist>
+</para>
+-->
+
</section>
<!--
vim: tw=66 syntax=docbk
diff --git a/doc/user/stored-programs.xml b/doc/user/stored-programs.xml
index fe87793..fd580c2 100644
--- a/doc/user/stored-programs.xml
+++ b/doc/user/stored-programs.xml
@@ -20,7 +20,7 @@
</para>
</blockquote>
<para>
- Procedures can be invoked both from the administrative
+ Procedures can be invoked from the administrative
console and using the binary protocol, for example:
<programlisting><computeroutput>localhost> lua function f1() return 'hello' end
---
@@ -58,6 +58,43 @@ localhost> lua "hello".." world"
</computeroutput></programlisting>
</para>
<para>
+ Lua procedures could also be called at the time of initialization
+ using a dedicated <emphasis>init.lua</emphasis> script,
+ located in <olink targetptr="work_dir" />.
+
+ An example of such a script is given below:
+ <programlisting>
+ <![CDATA[
+-- Importing expirationd module
+dofile("expirationd.lua")
+
+function is_expired(args, tuple)
+ if tuple == nil then
+ return true
+ end
+
+ if #tuple <= args.field_no then
+ return true
+ end
+
+ field = tuple[args.field_no]
+ if field == nil or #field ~= 4 then
+ return true
+ end
+
+ local current_time = os.time()
+ local tuple_ts = box.unpack("i", field)
+ return current_time >= tuple_ts + args.ttl
+end
+
+-- Run task
+expirationd.run_task("exprd space 0", 0, is_expired, nil,
+ { field_no = 1, ttl = 30 * 60 })
+]]>
+ </programlisting>
+ </para>
+
+ <para>
There is a single global instance of Lua interpreter, which is
shared across all connections. Anything prefixed with
<code>lua </code> on the administrative console is sent
================================================================
Commit: efa8f2a46bf308111798f6a94535dacfe2bc43a4
https://github.com/mailru/tarantool/commit/efa8f2a46bf308111798f6a94535dacfe2bc43a4
Author: pcherenkov <[email protected]>
Date: 2012-05-03 (Thu, 03 May 2012)
Changed paths:
M doc/user/configuration-reference.xml
M doc/user/persistence-architecture.xml
Log Message:
-----------
Merge branch 'bug988508'
diff --git a/doc/user/configuration-reference.xml
b/doc/user/configuration-reference.xml
index 9f60c14..de9a2af 100644
--- a/doc/user/configuration-reference.xml
+++ b/doc/user/configuration-reference.xml
@@ -547,6 +547,22 @@ tarantool_box: primary@sessions pri:33013 sec:33014
adm:33015</programlisting>
recovery.</entry>
</row>
+ <row>
+ <entry xml:id="wal_mode" xreflabel="wal_mode">wal_mode</entry>
+ <entry>string</entry>
+ <entry>"fsync_delay"</entry>
+ <entry>no</entry>
+ <entry>yes</entry>
+ <entry>Specify fiber-WAL-disk synchronization mode as:
+ <emphasis>write:</emphasis> fibers wait for their data to
+ be written to WAL (no fsync(2)); <emphasis>fsync</emphasis>:
+ fibers wait for their data, fsync(2) follows each write(2);
+ <emphasis>fsync_delay</emphasis>: fibers wait for their
+ data, fsync(2) is called every
N=<emphasis>wal_fsync_delay</emphasis>
+ seconds (N=0.0 means no fsync(2) - equivalent to
+ <emphasis>wal_mode = "write"</emphasis>);</entry>
+ </row>
+
</tbody>
</tgroup>
</table>
diff --git a/doc/user/persistence-architecture.xml
b/doc/user/persistence-architecture.xml
index d9f51dd..e1c3aa7 100644
--- a/doc/user/persistence-architecture.xml
+++ b/doc/user/persistence-architecture.xml
@@ -70,42 +70,11 @@ by disk load.
</para>
<para>
-WAL writer ensures data consistency and synchronization
-between requesting fibers, WAL writer and disk by
-employing one the following modes of operation (designated by
-<emphasis>wal_mode</emphasis> and
-<emphasis>wal_fsync_delay</emphasis> configuration keys):
-<orderedlist>
- <listitem><para><emphasis>write</emphasis>: fibers wait for their
- data to be written to the log (no fsync(2));</para></listitem>
- <listitem><para><emphasis>fsync</emphasis>: fibers wait for their
- data, fsync(2) follows each write(2);</para></listitem>
- <listitem><para><emphasis>fsync_delay</emphasis>: fibers wait for their
- data, fsync every N=<emphasis>wal_fsync_delay</emphasis>
- seconds (N=0.0 means no fsync(2) - equivalent to
- <emphasis>wal_mode = "write"</emphasis>);</para></listitem>
-</orderedlist>
+WAL writer employs a number of modes for synchronization between
+requesting fibers, WAL writer and disk hardware, as defined
+in configuration for <olink targetptr="wal_mode"/>.
</para>
-<!--
-<para>
-WAL writer ensures data consistency and synchronization
-between requesting fibers, WAL writer and disk by
-employing one the following modes of operation (designated by
-<emphasis>wal_mode</emphasis> and
-<emphasis>wal_fsync_delay</emphasis> configuration keys):
-<orderedlist>
- <listitem><emphasis>write</emphasis>: fibers wait for their
- data to be written to the log (no fsync(2));</listitem>
- <listitem><emphasis>fsync</emphasis>: fibers wait for their
- data, fsync(2) follows each write(2);</listitem>
- <listitem><emphasis>fsync_delay</emphasis>: fibers wait for their
- data, fsync every N=<emphasis>wal_fsync_delay</emphasis>
- seconds (N=0.0 means no fsync(2) - equivalent to
- <emphasis>wal_mode = "write"</emphasis>);</listitem>
-</orderedlist>
-</para>
--->
</section>
<!--
================================================================
Compare: https://github.com/mailru/tarantool/compare/cc0868e^...efa8f2a
_______________________________________________
Mailing list: https://launchpad.net/~tarantool-developers
Post to : [email protected]
Unsubscribe : https://launchpad.net/~tarantool-developers
More help : https://help.launchpad.net/ListHelp