Skip to content
Snippets Groups Projects
Commit a1d666fd authored by pcherenkov's avatar pcherenkov
Browse files

Merge branch 'bug923715'

parents 97f090b0 620d90b3
No related branches found
No related tags found
No related merge requests found
...@@ -259,7 +259,7 @@ lsn:4 tm:1301572313.691 t:65534 127.0.0.1:52728 UPDATE_FIELDS n:0flags:00000000 ...@@ -259,7 +259,7 @@ lsn:4 tm:1301572313.691 t:65534 127.0.0.1:52728 UPDATE_FIELDS n:0flags:00000000
</row> </row>
<row> <row>
<entry>work_dir</entry> <entry xml:id="work_dir" xreflabel="work_dir">work_dir</entry>
<entry>string</entry> <entry>string</entry>
<entry>""</entry> <entry>""</entry>
<entry>no</entry> <entry>no</entry>
......
...@@ -69,6 +69,44 @@ provided SELECTs are run in their own connections, is unaffected ...@@ -69,6 +69,44 @@ provided SELECTs are run in their own connections, is unaffected
by disk load. by disk load.
</para> </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> </section>
<!-- <!--
vim: tw=66 syntax=docbk vim: tw=66 syntax=docbk
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</para> </para>
</blockquote> </blockquote>
<para> <para>
Procedures can be invoked both from the administrative Procedures can be invoked from the administrative
console and using the binary protocol, for example: console and using the binary protocol, for example:
<programlisting><computeroutput>localhost> lua function f1() return 'hello' end <programlisting><computeroutput>localhost> lua function f1() return 'hello' end
--- ---
...@@ -57,6 +57,43 @@ localhost> lua "hello".." world" ...@@ -57,6 +57,43 @@ localhost> lua "hello".." world"
... ...
</computeroutput></programlisting> </computeroutput></programlisting>
</para> </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> <para>
There is a single global instance of Lua interpreter, which is There is a single global instance of Lua interpreter, which is
shared across all connections. Anything prefixed with shared across all connections. Anything prefixed with
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment