diff --git a/doc/user/configuration-reference.xml b/doc/user/configuration-reference.xml index 0aae2c2488ae067f5f6a0e3d44a57711bccd757e..81b2ccca1f47f8cf597db2f0fb1075a36cf4bda5 100644 --- a/doc/user/configuration-reference.xml +++ b/doc/user/configuration-reference.xml @@ -194,11 +194,8 @@ lsn:4 tm:1301572313.691 t:65534 127.0.0.1:52728 UPDATE_FIELDS n:0flags:00000000 <para> To facilitate centralized and automated configuration management, runtime configuration modifications are supported - solely through <emphasis role="tntadmin" - xlink:href="tarantool-user-guide#reload-configuration" - xlink:title="reload configuration" - xlink:role="http://docbook.org/xlink/role/olink">reload - configuration</emphasis> administrative statement. Thus, the + solely through <olink targetptr="reload-configuration"/> + administrative statement. Thus, the procedure to change Tarantool configuration at runtime is to edit the configuration file. This ensures that, should the server get killed or restart, no unexpected changes to @@ -209,12 +206,9 @@ lsn:4 tm:1301572313.691 t:65534 127.0.0.1:52728 UPDATE_FIELDS n:0flags:00000000 such settings will be highlighted in this reference. If the same setting is given more than once, the latest occurrence takes effect. - You can always invoke <emphasis role="tntadmin" - xlink:href="tarantool-user-guide#show-configuration" - xlink:title="show configuration" - xlink:role="http://docbook.org/xlink/role/olink">show - configuration</emphasis> from the administrative - console to show the current configuration. + You can always invoke <olink targetptr="show-configuration"/> + from the administrative console to show the current + configuration. </para> <para> Tarantool maintains a set of all allowed configuration @@ -389,7 +383,7 @@ tarantool: box:primary@sessions pri:33013 sec:33014 adm:33015</programlisting> <tbody> <row> - <entry>slab_alloc_arena</entry> + <entry xml:id="slab_alloc_arena" xreflabel="slab_alloc_arena">slab_alloc_arena</entry> <entry>float</entry> <entry>1.0</entry> <entry>no</entry> @@ -398,7 +392,8 @@ tarantool: box:primary@sessions pri:33013 sec:33014 adm:33015</programlisting> store tuples, <emphasis role="strong">in gigabytes</emphasis>. When the limit is reached, INSERT or UPDATE requests begin failing with error - ERR_CODE_MEMORY_ISSUE. While the server does not go + <olink targetptr="ERR_CODE_MEMORY_ISSUE"/>. + While the server does not go beyond the defined limit to allocate tuples, there is additional memory used to store indexes and connection information. Depending on actual configuration and @@ -445,24 +440,98 @@ tarantool: box:primary@sessions pri:33013 sec:33014 adm:33015</programlisting> </entry> </row> + </tbody> + </tgroup> + </table> + + <table frame='all'> + <title>Binary logging, snapshots and replication</title> + <tgroup cols='6' colsep='1' rowsep='1'> + + <thead> + <row> + <entry>Name</entry> + <entry>Type</entry> + <entry>Default</entry> + <entry>Required?</entry> + <entry>Dynamic?</entry> + <entry>Description</entry> + </row> + </thead> + + <tbody> + + <row> + <entry>panic_on_snap_error</entry> + <entry>boolean</entry> + <entry>1</entry> + <entry>no</entry> + <entry>no</entry> + <entry>If there is an error reading the snapshot (at + server start), abort.</entry> + </row> + + <row> + <entry>panic_on_wal_error</entry> + <entry>boolean</entry> + <entry>0</entry> + <entry>no</entry> + <entry>no</entry> + <entry>If there is an error reading from a write ahead + log (at server start), abort.</entry> + </row> </tbody> </tgroup> </table> <!-- - Storage parameters. ****************** -## BOX +Replication settings +******************** +# Write no more rows in WAL +rows_per_wal=500000, ro -# panic if where is error reading snap or wal -# be default panic any snapshot reading error and ignore errors then reading wals -panic_on_snap_error=1, ro -panic_on_wal_error=0, ro +# delay between loop iterations +io_collect_interval=0.0, ro +# do not write snapshot faster then snap_io_rate_limit MBytes/sec +snap_io_rate_limit=0.0, ro + +# fsync WAL delay, only issue fsync if last fsync was wal_fsync_delay seconds ago +# WARNING: actually, several last requsts may stall for much longer +wal_fsync_delay=0, ro + +# size of WAL writer requests buffer +wal_writer_inbox_size=128, ro + +# network io readahead +readahead=16320 +# size of listen backlog +backlog=1024, ro +--> +<!-- + </table> + + <table> + <title>Replication</title> +--> +<!-- +# Remote hot standby (if enabled server will run in hot standby mode +# continuously fetching WAL records from wal_feeder_ipaddr:wal_feeder_port +remote_hot_standby=0, ro +wal_feeder_ipaddr=NULL, ro +wal_feeder_port=0, ro + +--> +<!-- + </table> + + <table> + <title>Memcached support</title> --> <table frame='all'> @@ -623,58 +692,6 @@ panic_on_wal_error=0, ro </tgroup> </table> -<!-- - <table frame='all'> - <title>Networking and file I/O</title> ---> -<!-- -Network-related settings -****************** - -# network io readahead -readahead=16320 -# size of listen backlog -backlog=1024, ro - -Replication settings -******************** - -# delay between loop iterations -io_collect_interval=0.0, ro -# do not write snapshot faster then snap_io_rate_limit MBytes/sec -snap_io_rate_limit=0.0, ro - -# Write no more rows in WAL -rows_per_wal=500000, ro - -# fsync WAL delay, only issue fsync if last fsync was wal_fsync_delay seconds ago -# WARNING: actually, several last requsts may stall for much longer -wal_fsync_delay=0, ro - -# size of WAL writer requests buffer -wal_writer_inbox_size=128, ro ---> -<!-- - </table> - - <table> - <title>Replication</title> ---> -<!-- -# Remote hot standby (if enabled server will run in hot standby mode -# continuously fetching WAL records from wal_feeder_ipaddr:wal_feeder_port -remote_hot_standby=0, ro -wal_feeder_ipaddr=NULL, ro -wal_feeder_port=0, ro - ---> -<!-- - </table> - - <table> - <title>Memcached support</title> ---> - </section> </chapter> diff --git a/doc/user/errcode.xml b/doc/user/errcode.xml new file mode 100644 index 0000000000000000000000000000000000000000..5d23b526e4a53b29d8bf2a5ffbbe068229daafcc --- /dev/null +++ b/doc/user/errcode.xml @@ -0,0 +1,77 @@ +<appendix xmlns="http://docbook.org/ns/docbook" version="5.0" + xmlns:xlink="http://www.w3.org/1999/xlink" + xml:id="errcode"> + +<title>List of error codes</title> + +<para>In the current version of the binary protocol, error message, +which is normally more descriptive than error code, +is not present in server response. The actual message may contain +a file name, a detailed reason or operating system error code. +All such messages, however, are logged in the error log. When +using memcached protocol, the error message is sent to the +client along with the code. Below follow only general descriptions +of existing codes.</para> +<variablelist> +<title>List of error codes</title> + + <varlistentry> + <term xml:id="ERR_CODE_NONMASTER" xreflabel="ERR_CODE_NONMASTER">ERR_CODE_NONMASTER</term> + <listitem><para>Attempt to execute an update over the + secondary (read-only) port or on a running replica. + </para></listitem> + </varlistentry> + + <varlistentry> + <term xml:id="ERR_CODE_ILLEGAL_PARAMS" xreflabel="ERR_CODE_ILLEGAL_PARAMS">ERR_CODE_ILLEGAL_PARAMS</term> + <listitem><para>Illegal parameters. Malformed protocol + message. + </para></listitem> + </varlistentry> + + <varlistentry> + <term xml:id="ERR_CODE_NODE_IS_RO" xreflabel="ERR_CODE_NODE_IS_RO">ERR_CODE_NODE_IS_RO</term> + <listitem><para>A parallel update of a tuple is in progress. Try again. + </para></listitem> + </varlistentry> + + <varlistentry> + <term xml:id="ERR_CODE_MEMORY_ISSUE" xreflabel="ERR_CODE_MEMORY_ISSUE">ERR_CODE_MEMORY_ISSUE</term> + <listitem><para>Out of memory: <olink targetptr="slab_alloc_arena"/> limit is reached. + </para></listitem> + </varlistentry> + + <varlistentry> + <term xml:id="ERR_CODE_WAL_IO" xreflabel="ERR_CODE_WAL_IO">ERR_CODE_WAL_IO</term> + <listitem><para>Failed to record the change in the write ahead + log. Some sort of disk error. + </para></listitem> + </varlistentry> + + <varlistentry> + <term xml:id="ERR_CODE_INDEX_VIOLATION" xreflabel="ERR_CODE_INDEX_VIOLATION">ERR_CODE_INDEX_VIOLATION</term> + <listitem><para>A unique index constraint violation: a tuple with the same + key is already present in the index. + </para></listitem> + </varlistentry> + + <varlistentry> + <term xml:id="ERR_CODE_NO_SUCH_NAMESPACE" xreflabel="ERR_CODE_NO_SUCH_NAMESPACE">ERR_CODE_NO_SUCH_NAMESPACE</term> + <listitem><para>Attempt to access a namespace that is not + configured (doesn't exist). + </para></listitem> + </varlistentry> + + <varlistentry> + <term xml:id="ERR_CODE_NO_SUCH_INDEX" xreflabel="ERR_CODE_NO_SUCH_INDEX">ERR_CODE_NO_SUCH_INDEX</term> + <listitem><para>No index with the given id exists. + </para></listitem> + </varlistentry> + +</variablelist> +</appendix> + +<!-- +vim: tw=66 syntax=docbk +vim: spell spelllang=en_us +--> diff --git a/doc/user/language-reference.xml b/doc/user/language-reference.xml index 5e29a3c84385ba67dbe50e554c56fb42298722cc..e32d889c844c153e017474767cc6cd19a35afdc7 100644 --- a/doc/user/language-reference.xml +++ b/doc/user/language-reference.xml @@ -79,11 +79,11 @@ Tarantool replies to administrative command in YAML. </para> - <para><emphasis xml:id="reload-configuration" role="tntadmin">reload - configuration</emphasis>Re-read the configuration file. If the + <para><emphasis xml:id="reload-configuration" xreflabel="RELOAD CONFIGURATION" role="tntadmin">reload + configuration</emphasis> Re-read the configuration file. If the file contains changes to dynamic parameters, update the runtime settings. If configuration syntax is incorrect, or a read-only parameter is changed, produce an error and do nothing.</para> - <para><emphasis xml:id="show-configuration" role="tntadmin">show + <para><emphasis xml:id="show-configuration" xreflabel="SHOW CONFIGURATION" role="tntadmin">show configuration</emphasis> Show the current settings. Displays all settings, including those that have default values and thus are not necessarily present in the configuration file.</para> diff --git a/doc/user/namespace.xml b/doc/user/namespace.xml index ef4b25d63015770d318960e1e920e4d5edcc1ddf..1310bea3104cb10ced4f5c416971772a2a37e5ea 100644 --- a/doc/user/namespace.xml +++ b/doc/user/namespace.xml @@ -3,8 +3,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="namespace"> <bridgehead>Namespace settings explained</bridgehead> -Namespace is a composite setting, i.e. it has a number -of properties. +Namespace is a composite parameter, i.e. it has properties. <programlisting language="cpp"> /* * Each tuple consists of fields. Three field types are @@ -31,10 +30,10 @@ struct index_field_t { enum { HASH, TREE } index_type; struct index_t { - + index_field_t key_field[]; enum index_type type; + /* Secondary index may be non-unique */ bool unique; - index_field_t key_field[]; }; struct namespace_t diff --git a/doc/user/preface.xml b/doc/user/preface.xml index bbe0106d350f03c00eee4dc4c777bdb5a1923f40..34c7bd612fdca285a856eceacdf356713b31edcb 100644 --- a/doc/user/preface.xml +++ b/doc/user/preface.xml @@ -96,13 +96,11 @@ xlink:href="http://www.docbook.org/tdg5/en/html/docbook.html">DocBook 5</citetitle> XML markup language and is using the standard <citetitle xlink:href="http://docbook.sourceforge.net/release/xsl/current/doc/">DocbBook - XSL</citetitle> formatting conventions: - </para> + XSL</citetitle> formatting conventions:</para> <para> UNIX shell command input is prefixed with '$ ' and is formatted using a fixed-width font: - <programlisting> - <prompt>$ </prompt>tarantool_box <option>--daemonize</option> + <programlisting><prompt>$ </prompt>tarantool_box <option>--daemonize</option> </programlisting> </para> <para> diff --git a/doc/user/target.db b/doc/user/target.db index 0968f9fae8f51bfca81642781805929b1f0204a3..6e72234af57972f8c47d28558d57556dbdf2bba0 100644 --- a/doc/user/target.db +++ b/doc/user/target.db @@ -1 +1 @@ -<div element="book" href="#tarantool-user-guide" number="" targetptr="tarantool-user-guide"><ttl>Tarantool/Box User Guide, version 1.4.1-29-gde07102</ttl><xreftext>Tarantool/Box User Guide, version 1.4.1-29-gde07102</xreftext><div element="chapter" href="#id286512" number="1"><ttl>Preface</ttl><xreftext>Chapter 1, <i>Preface</i></xreftext><div element="section" href="#preface" number="" targetptr="preface"><ttl>Tarantool/Box: an overview</ttl><xreftext>the section called “Tarantool/Box: an overviewâ€</xreftext></div><div element="section" href="#id285445" number=""><ttl>Conventions</ttl><xreftext>the section called “Conventionsâ€</xreftext></div><div element="section" href="#id285520" number=""><ttl>Reporting bugs</ttl><xreftext>the section called “Reporting bugsâ€</xreftext></div></div><div element="chapter" href="#id285410" number="2"><ttl>Getting started</ttl><xreftext>Chapter 2, <i>Getting started</i></xreftext></div><div element="chapter" href="#id287670" number="3"><ttl>Dynamic data model</ttl><xreftext>Chapter 3, <i>Dynamic data model</i></xreftext></div><div element="chapter" href="#language-reference" number="4" targetptr="language-reference"><ttl>Language reference</ttl><xreftext>Chapter 4, <i>Language reference</i></xreftext><div element="section" href="#id288016" number=""><ttl>Administrative console</ttl><xreftext>the section called “Administrative consoleâ€</xreftext><obj element="emphasis" href="#reload-configuration" number="" targetptr="reload-configuration"><ttl>???TITLE???</ttl><xreftext>???</xreftext></obj><obj element="emphasis" href="#show-configuration" number="" targetptr="show-configuration"><ttl>???TITLE???</ttl><xreftext>???</xreftext></obj></div></div><div element="chapter" href="#configuration-reference" number="5" targetptr="configuration-reference"><ttl>Configuration reference</ttl><xreftext>Chapter 5, <i>Configuration reference</i></xreftext><div element="section" href="#id285844" number=""><ttl>Command line options</ttl><xreftext>the section called “Command line optionsâ€</xreftext><obj element="listitem" href="#help-option" number="" targetptr="help-option"><ttl>???TITLE???</ttl><xreftext/></obj><obj element="listitem" href="#version-option" number="" targetptr="version-option"><ttl>???TITLE???</ttl><xreftext/></obj><obj element="listitem" href="#config-option" number="" targetptr="config-option"><ttl>???TITLE???</ttl><xreftext/></obj></div><div element="section" href="#id289585" number=""><ttl>The option file</ttl><xreftext>the section called “The option fileâ€</xreftext><obj element="table" href="#id289684" number="5.1"><ttl>Basic parameters</ttl><xreftext>Table 5.1, “Basic parametersâ€</xreftext></obj><obj element="table" href="#id290026" number="5.2"><ttl>Configuring the storage</ttl><xreftext>Table 5.2, “Configuring the storageâ€</xreftext></obj><obj element="para" href="#namespace" number="" targetptr="namespace"><ttl>???TITLE???</ttl><xreftext>the section called “The option fileâ€</xreftext></obj><obj element="table" href="#id290263" number="5.3"><ttl>Logging</ttl><xreftext>Table 5.3, “Loggingâ€</xreftext></obj><obj element="table" href="#id290450" number="5.4"><ttl>Memcached protocol support</ttl><xreftext>Table 5.4, “Memcached protocol supportâ€</xreftext></obj></div></div></div> +<div element="book" href="#tarantool-user-guide" number="" targetptr="tarantool-user-guide"><ttl>Tarantool/Box User Guide, version 1.4.1-30-gc8e17c6</ttl><xreftext>Tarantool/Box User Guide, version 1.4.1-30-gc8e17c6</xreftext><div element="chapter" href="#id362532" number="1"><ttl>Preface</ttl><xreftext>Chapter 1, <i>Preface</i></xreftext><div element="section" href="#preface" number="" targetptr="preface"><ttl>Tarantool/Box: an overview</ttl><xreftext>the section called “Tarantool/Box: an overviewâ€</xreftext></div><div element="section" href="#id362575" number=""><ttl>Conventions</ttl><xreftext>the section called “Conventionsâ€</xreftext></div><div element="section" href="#id362649" number=""><ttl>Reporting bugs</ttl><xreftext>the section called “Reporting bugsâ€</xreftext></div></div><div element="chapter" href="#id363788" number="2"><ttl>Getting started</ttl><xreftext>Chapter 2, <i>Getting started</i></xreftext></div><div element="chapter" href="#id364795" number="3"><ttl>Dynamic data model</ttl><xreftext>Chapter 3, <i>Dynamic data model</i></xreftext></div><div element="chapter" href="#language-reference" number="4" targetptr="language-reference"><ttl>Language reference</ttl><xreftext>Chapter 4, <i>Language reference</i></xreftext><div element="section" href="#id362959" number=""><ttl>Administrative console</ttl><xreftext>the section called “Administrative consoleâ€</xreftext><obj element="emphasis" href="#reload-configuration" number="" targetptr="reload-configuration"><ttl>???TITLE???</ttl><xreftext>RELOAD CONFIGURATION</xreftext></obj><obj element="emphasis" href="#show-configuration" number="" targetptr="show-configuration"><ttl>???TITLE???</ttl><xreftext>SHOW CONFIGURATION</xreftext></obj></div></div><div element="chapter" href="#configuration-reference" number="5" targetptr="configuration-reference"><ttl>Configuration reference</ttl><xreftext>Chapter 5, <i>Configuration reference</i></xreftext><div element="section" href="#id363074" number=""><ttl>Command line options</ttl><xreftext>the section called “Command line optionsâ€</xreftext><obj element="listitem" href="#help-option" number="" targetptr="help-option"><ttl>???TITLE???</ttl><xreftext/></obj><obj element="listitem" href="#version-option" number="" targetptr="version-option"><ttl>???TITLE???</ttl><xreftext/></obj><obj element="listitem" href="#config-option" number="" targetptr="config-option"><ttl>???TITLE???</ttl><xreftext/></obj></div><div element="section" href="#id364408" number=""><ttl>The option file</ttl><xreftext>the section called “The option fileâ€</xreftext><obj element="table" href="#id366923" number="5.1"><ttl>Basic parameters</ttl><xreftext>Table 5.1, “Basic parametersâ€</xreftext></obj><obj element="table" href="#id367265" number="5.2"><ttl>Configuring the storage</ttl><xreftext>Table 5.2, “Configuring the storageâ€</xreftext></obj><obj element="entry" href="#slab_alloc_arena" number="" targetptr="slab_alloc_arena"><ttl>???TITLE???</ttl><xreftext>slab_alloc_arena</xreftext></obj><obj element="para" href="#namespace" number="" targetptr="namespace"><ttl>???TITLE???</ttl><xreftext>the section called “The option fileâ€</xreftext></obj><obj element="table" href="#id367533" number="5.3"><ttl>Binary logging, snapshots and replication</ttl><xreftext>Table 5.3, “Binary logging, snapshots and replicationâ€</xreftext></obj><obj element="table" href="#id367659" number="5.4"><ttl>Logging</ttl><xreftext>Table 5.4, “Loggingâ€</xreftext></obj><obj element="table" href="#id367845" number="5.5"><ttl>Memcached protocol support</ttl><xreftext>Table 5.5, “Memcached protocol supportâ€</xreftext></obj></div></div><div element="appendix" href="#errcode" number="A" targetptr="errcode"><ttl>List of error codes</ttl><xreftext>Appendix A, <i>List of error codes</i></xreftext><obj element="term" href="#ERR_CODE_NONMASTER" number="" targetptr="ERR_CODE_NONMASTER"><ttl>???TITLE???</ttl><xreftext>ERR_CODE_NONMASTER</xreftext></obj><obj element="term" href="#ERR_CODE_ILLEGAL_PARAMS" number="" targetptr="ERR_CODE_ILLEGAL_PARAMS"><ttl>???TITLE???</ttl><xreftext>ERR_CODE_ILLEGAL_PARAMS</xreftext></obj><obj element="term" href="#ERR_CODE_NODE_IS_RO" number="" targetptr="ERR_CODE_NODE_IS_RO"><ttl>???TITLE???</ttl><xreftext>ERR_CODE_NODE_IS_RO</xreftext></obj><obj element="term" href="#ERR_CODE_MEMORY_ISSUE" number="" targetptr="ERR_CODE_MEMORY_ISSUE"><ttl>???TITLE???</ttl><xreftext>ERR_CODE_MEMORY_ISSUE</xreftext></obj><obj element="term" href="#ERR_CODE_WAL_IO" number="" targetptr="ERR_CODE_WAL_IO"><ttl>???TITLE???</ttl><xreftext>ERR_CODE_WAL_IO</xreftext></obj><obj element="term" href="#ERR_CODE_INDEX_VIOLATION" number="" targetptr="ERR_CODE_INDEX_VIOLATION"><ttl>???TITLE???</ttl><xreftext>ERR_CODE_INDEX_VIOLATION</xreftext></obj><obj element="term" href="#ERR_CODE_NO_SUCH_NAMESPACE" number="" targetptr="ERR_CODE_NO_SUCH_NAMESPACE"><ttl>???TITLE???</ttl><xreftext>ERR_CODE_NO_SUCH_NAMESPACE</xreftext></obj><obj element="term" href="#ERR_CODE_NO_SUCH_INDEX" number="" targetptr="ERR_CODE_NO_SUCH_INDEX"><ttl>???TITLE???</ttl><xreftext>ERR_CODE_NO_SUCH_INDEX</xreftext></obj></div></div> diff --git a/doc/user/tnt-html.xsl b/doc/user/tnt-html.xsl index acb58dd99c8d93fe077c59fdd4d6480a9341f2a3..dd3ce1cbb9482e2c0e1409b7bcb60d88b56add1e 100644 --- a/doc/user/tnt-html.xsl +++ b/doc/user/tnt-html.xsl @@ -7,6 +7,7 @@ <xsl:import href="html-highlight.xsl"/> +<xsl:param name="generate.toc" select="'book toc'"/> <xsl:param name="html.stylesheet" select="'tnt.css'"/> <xsl:param name="highlight.source" select="1"/> <xsl:param name="highlight.xslthl.config">file:////usr/share/xml/docbook/stylesheet/docbook-xsl-ns/highlighting/xslthl-config.xml</xsl:param> diff --git a/doc/user/tutorial.xml b/doc/user/tutorial.xml index 2b9b1473212581a9f2e7459be383ab8a7ae620a0..f38b015635e4c815999fab38393f52052cc8527b 100644 --- a/doc/user/tutorial.xml +++ b/doc/user/tutorial.xml @@ -34,7 +34,8 @@ To build Tarantool from source, additionally: <itemizedlist> <listitem><para>CMake 2.6 or newer,</para></listitem> - <listitem><para>GCC 4.4 or newer.</para></listitem> + <listitem><para>GCC 4.4 or newer, with gcc-objc (ObjectiveC) + language frontend.</para></listitem> </itemizedlist> </para> <para> @@ -114,7 +115,8 @@ <para> Congratulations, you have the server up and running. Check out the remaining chapters of this manual to learn - more about available commands, contents of tarantool.cfg, + more about available commands, contents of + <filename>tarantool.cfg</filename>, replication and high availability with Tarantool. </para> </sidebar> diff --git a/doc/user/user.xml b/doc/user/user.xml index 9f859bde2a8e715a16c1040afa4e3e848fe3159b..02e677b59e01e1931acb5159065c31f5354aef3c 100644 --- a/doc/user/user.xml +++ b/doc/user/user.xml @@ -19,8 +19,9 @@ <xi:include href="configuration.xml"/> <xi:include href="logging.xml"/> <xi:include href="connectors.xml"/> -<xi:include href="appendix.xml"/> +<xi:include href="faq.xml"/> --> +<xi:include href="errcode.xml"/> <!-- TOC: diff --git a/include/errcode.h b/include/errcode.h index 220cee4b7a52a3f8c64fe9a431fbf4d7fc9075b0..ba7ad4e1e750e48606e7c040a8391caa2075f947 100644 --- a/include/errcode.h +++ b/include/errcode.h @@ -11,6 +11,17 @@ struct errcode_record { uint8_t errflags; }; +/* + * To add a new error code to Tarantool, extend this array. Please + * try to reuse empty slots (ERR_CODE_UNUSED*), if there are any + * left. + * + * !IMPORTANT! Currently you need to manually update the user + * guide (doc/user/errcode.xml) and the Python command line client + * (test/lib/sql_ast.py) with each added error code. Please don't + * forget to do it! + */ + #define ERROR_CODES(_) \ /* 0 */_(ERR_CODE_OK, 0, "OK") \ /* 1 */_(ERR_CODE_NONMASTER, 2, "Non master connection, but it should be") \ @@ -55,7 +66,7 @@ struct errcode_record { /* 37 */_(ERR_CODE_UPDATE_ID, 2, "Id's update") \ /* 38 */_(ERR_CODE_WRONG_VERSION, 2, "Unsupported version of protocol") \ /* end of silversearch error codes */ \ - /* 39 */_(ERR_CODE_UNKNOWN_ERROR, 2, "Unknown error") \ + /* 39 */_(ERR_CODE_WAL_IO, 2, "Failed to write to disk") \ /* 40 */_(ERR_CODE_UNUSED40, 0, "Unused40") \ /* 41 */_(ERR_CODE_UNUSED41, 0, "Unused41") \ /* 42 */_(ERR_CODE_UNUSED42, 0, "Unused42") \ @@ -76,6 +87,12 @@ struct errcode_record { /* 57 */_(ERR_CODE_NO_SUCH_NAMESPACE, 2, "There is no such namespace") \ _(ERR_CODE_NO_SUCH_INDEX, 2, "No index with the given id is defined") + +/* + * !IMPORTANT! Please see an instruction how to add !IMPORTANT! + * !IMPORTANT! new errors at start of the file !IMPORTANT! + */ + ENUM0(tnt_error_codes_enum, ERROR_CODES); extern struct errcode_record tnt_error_codes[]; diff --git a/mod/box/box.m b/mod/box/box.m index 16b1674bb1504f3d42c285a7b034907c181b0139..8602832122be9a2bbadc7f1daba7b791429b88f5 100644 --- a/mod/box/box.m +++ b/mod/box/box.m @@ -820,7 +820,7 @@ txn_commit(struct box_txn *txn) i64 lsn = next_lsn(recovery_state, 0); if (!wal_write(recovery_state, wal_tag, fiber->cookie, lsn, t)) - tnt_raise(tnt_BoxException, errcode:ERR_CODE_UNKNOWN_ERROR); + tnt_raise(tnt_BoxException, errcode:ERR_CODE_WAL_IO); confirm_lsn(recovery_state, lsn); } @@ -1218,7 +1218,7 @@ box_process(struct box_txn *txn, u32 op, struct tbuf *request_data) say_error("tnt_PickleException: `%s' at %s:%i", e->reason, e->file, e->line); - return ERR_CODE_UNKNOWN_ERROR; + return ERR_CODE_ILLEGAL_PARAMS; } @catch (tnt_BoxException *e) { txn_abort(txn);