Changeset: 5f922d94dd48 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/5f922d94dd48
Branch: windowfun_cleanup
Log Message:

Merge with default.


diffs (truncated from 6766 to 300 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -814,3 +814,4 @@ 1efa83c6409769d13b2ee30e497d5f7ab42fa955
 6f88424ebfd9d82c072cf21d89070e04321983da Jun2023_11
 6f88424ebfd9d82c072cf21d89070e04321983da Jun2023_SP2_release
 e6eb06773c17035954ac5d001cfe1f09ff3425cc Jun2023_13
+5683fd900f28d65ad7c98d1ed1efd992023a7fa4 Jun2023_15
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -867,6 +867,17 @@ fi
 %endif
 
 %changelog
+* Thu Nov 09 2023 Sjoerd Mullender <sjo...@acm.org> - 11.47.15-20231109
+- Rebuilt.
+- GH#7410: SIGSEGV cause database corruption
+
+* Tue Nov  7 2023 Sjoerd Mullender <sjo...@acm.org> - 11.47.15-20231109
+- gdk: When saving the SQL catalog during a low-level commit, we should
+  only save the part of the catalog that corresponds to the part of the
+  write-ahead log that has been processed.  What we did was save more,
+  which resulted in the catalog containing references to tables and
+  columns whose disk presence is otherwise only in the write-ahead log.
+
 * Fri Nov 03 2023 Sjoerd Mullender <sjo...@acm.org> - 11.47.13-20231103
 - Rebuilt.
 - GH#7300: Implement missing standard SQL DATE and TIMESTAMP functions
diff --git a/clients/examples/python/mclient-python3.py 
b/clients/examples/python/mclient-python3.py
--- a/clients/examples/python/mclient-python3.py
+++ b/clients/examples/python/mclient-python3.py
@@ -65,7 +65,7 @@ def main() :
     line = fi.readline()
     if encoding != 'utf-8':
         prompt = str(prompt, 'utf-8').encode(encoding, 'replace')
-    while line and line != "\q\n":
+    while line and line != "\\q\n":
         if encoding != 'utf-8':
             line = str(line, encoding).encode('utf-8')
         res = s.cmd('s' + line)
diff --git a/clients/mapiclient/mclient.1 b/clients/mapiclient/mclient.1
--- a/clients/mapiclient/mclient.1
+++ b/clients/mapiclient/mclient.1
@@ -212,7 +212,7 @@ The possible values are
 .BR expanded ,
 .BR x ,
 .BR csv ,
-.BR csv-noquote ,
+.BR csv\-noquote ,
 .BR tab ,
 .BR raw ,
 .BR xml ,
@@ -221,7 +221,7 @@ and
 .BR rowcount .
 .B csv
 is comma-separated values;
-.B csv-noquote
+.B csv\-noquote
 is comma-separated values without escaping any quotes;
 .B tab
 is tab-separated values;
@@ -248,7 +248,7 @@ is a variation on
 where only the number of affected rows is printed.
 Normal \fBcsv\fP and \fBtab\fP formatting will use double quotes
 around any fields that contain double quotes, white space or the
-separator.  The \fBcsv-noquote\fP format will prevent that and dump
+separator.  The \fBcsv\-noquote\fP format will prevent that and dump
 the contents of the field without any interpretation.
 In addition to plain \fBcsv\fP, two other forms are possible.
 \fBcsv=\fP\fIc\fP uses \fIc\fP as column separator; \fBcsv+\fP\fIc\fP
@@ -539,7 +539,7 @@ in the above query can also be a URL.  I
 .IR e . g .,
 .IR https://www.example.org/dumpdata.csv .
 .PP
-See 
https://www.monetdb.org/documentation/user-guide/sql-manual/data-loading/copy-from/
+See 
https://www.monetdb.org/documentation/user\-guide/sql\-manual/data\-loading/copy\-from/
 for more information about the COPY INTO query.
 .SH SEE ALSO
 .IR msqldump (1),
diff --git a/cmake/monetdb-versions.cmake b/cmake/monetdb-versions.cmake
--- a/cmake/monetdb-versions.cmake
+++ b/cmake/monetdb-versions.cmake
@@ -42,7 +42,7 @@ set(MONETDB_VERSION "${MONETDB_VERSION_M
 # common/options and common/utils)
 set(GDK_VERSION_MAJOR "27")
 set(GDK_VERSION_MINOR "0")
-set(GDK_VERSION_PATCH "5")
+set(GDK_VERSION_PATCH "6")
 set(GDK_VERSION 
"${GDK_VERSION_MAJOR}.${GDK_VERSION_MINOR}.${GDK_VERSION_PATCH}")
 
 # version of the MAPI library (subdirectory clients/mapilib)
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,20 @@
+monetdb (11.47.15) unstable; urgency=low
+
+  * Rebuilt.
+  * GH#7410: SIGSEGV cause database corruption
+
+ -- Sjoerd Mullender <sjo...@acm.org>  Thu, 09 Nov 2023 17:03:15 +0100
+
+monetdb (11.47.15) unstable; urgency=low
+
+  * gdk: When saving the SQL catalog during a low-level commit, we should
+    only save the part of the catalog that corresponds to the part of the
+    write-ahead log that has been processed.  What we did was save more,
+    which resulted in the catalog containing references to tables and
+    columns whose disk presence is otherwise only in the write-ahead log.
+
+ -- Sjoerd Mullender <sjo...@acm.org>  Tue, 7 Nov 2023 17:03:15 +0100
+
 monetdb (11.47.13) unstable; urgency=low
 
   * Rebuilt.
diff --git a/documentation/source/manual_pages/monetdb.rst 
b/documentation/source/manual_pages/monetdb.rst
--- a/documentation/source/manual_pages/monetdb.rst
+++ b/documentation/source/manual_pages/monetdb.rst
@@ -71,7 +71,7 @@ allows to do wildcard matches. For detai
    maintenance mode. This allows the database administrator to perform
    initialization steps before releasing it to users, unless the **-p**
    argument is supplied. See also **monetdb lock**. The name of the
-   database must match the expression [A-Za-z0-9-_]+.
+   database must match the expression [A-Za-z0-9_-]+.
 
    **-m**\ *pattern*
       With the **-m** flag, instead of creating a database, a
@@ -259,6 +259,17 @@ successful.
       server to use less parallelism when executing queries, or none at
       all if set to **1**.
 
+   **ncopyintothreads=**\ *number*  
+      Defines the maximum number of worker threads the server should use
+      to perform COPY INTO from a CSV file. The actual number of threads
+      used is never higher than the number of columns, and is **1** if the
+      number of rows is small. Normally, this number is equal to the
+      value of the **nthreads** property. Using this number forces the
+      server to use more or less parallelism when executing COPY INTO.
+      Note, COPY INTO threads are created in addition to normal worker
+      threads for each COPY INTO query that is being executed and
+      therefore contend for the CPU with other queries.
+
    **optpipe=**\ *string*
       Each server operates with a given optimizer pipeline. While the
       default usually is the best setting, for some experimental uses
diff --git a/documentation/source/manual_pages/monetdbd.rst.in 
b/documentation/source/manual_pages/monetdbd.rst.in
--- a/documentation/source/manual_pages/monetdbd.rst.in
+++ b/documentation/source/manual_pages/monetdbd.rst.in
@@ -373,8 +373,8 @@ used with the funnel, as the results wil
 limited query buffer. Applications using the funnel should aim for short
 and single-statement queries that require no transactions.
 
-See the **create** command in the *monetdb*\ (1) man-page for details on
-how to setup a multiplex-funnel.
+See the **create** command in *monetdb*\ (1) for details on how to setup
+a multiplex-funnel.
 
 SIGNALS
 =======
diff --git a/documentation/source/manual_pages/mserver5.rst.in 
b/documentation/source/manual_pages/mserver5.rst.in
--- a/documentation/source/manual_pages/mserver5.rst.in
+++ b/documentation/source/manual_pages/mserver5.rst.in
@@ -23,7 +23,7 @@ Note that while *mserver5* is the proces
 is usually more common to start, monitor and connect to the *mserver5*
 process through *monetdbd*\ (1).
 
-This man-page describes the options that *mserver5* understands. It is
+This manual describes the options that *mserver5* understands. It is
 intended for people who really need to work with *mserver5* itself. In
 regular cases, the programs *monetdbd*\ (1) and *monetdb*\ (1) control
 the many options, and allow to adjust them to appropriate values where
diff --git a/gdk/ChangeLog-Archive b/gdk/ChangeLog-Archive
--- a/gdk/ChangeLog-Archive
+++ b/gdk/ChangeLog-Archive
@@ -1,6 +1,13 @@
 # DO NOT EDIT THIS FILE -- MAINTAINED AUTOMATICALLY
 # This file contains past ChangeLog entries
 
+* Tue Nov  7 2023 Sjoerd Mullender <sjo...@acm.org> - 11.47.15-20231109
+- When saving the SQL catalog during a low-level commit, we should
+  only save the part of the catalog that corresponds to the part of the
+  write-ahead log that has been processed.  What we did was save more,
+  which resulted in the catalog containing references to tables and
+  columns whose disk presence is otherwise only in the write-ahead log.
+
 * Tue Oct 31 2023 Sjoerd Mullender <sjo...@acm.org> - 11.47.13-20231103
 - A bug was fixed where the administration of which bats were in use was
   interpreted incorrectly during startup, causing problems later.  One
diff --git a/gdk/ChangeLog.Jun2023 b/gdk/ChangeLog.Jun2023
--- a/gdk/ChangeLog.Jun2023
+++ b/gdk/ChangeLog.Jun2023
@@ -1,10 +1,3 @@
 # ChangeLog file for GDK
 # This file is updated with Maddlog
 
-* Tue Nov  7 2023 Sjoerd Mullender <sjo...@acm.org>
-- When saving the SQL catalog during a low-level commit, we should
-  only save the part of the catalog that corresponds to the part of the
-  write-ahead log that has been processed.  What we did was save more,
-  which resulted in the catalog containing references to tables and
-  columns whose disk presence is otherwise only in the write-ahead log.
-
diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -1090,7 +1090,6 @@ log_open_output(logger *lg)
        logged_range *current = lg->current;
        assert(current && current->next == NULL);
        new_range->cnt = current->cnt;
-       new_range->deleted = current->deleted;
        current->next = new_range;
        ATOMIC_INC(&lg->nr_open_files);
        return GDK_SUCCEED;
@@ -1507,7 +1506,7 @@ bm_get_counts(logger *lg)
                        assert(b);
                        cnt = BATcount(b);
                } else {
-                       lid = BBP_desc(bids[p]) ? 1 : -1;
+                       lid = BBP_desc(bids[p]) && log_find(lg->catalog_bid, 
lg->dcatalog, bids[p]) == BUN_NONE ? 1 : -1;
                }
                if (BUNappend(lg->catalog_cnt, &cnt, false) != GDK_SUCCEED)
                        return GDK_FAIL;
@@ -1660,7 +1659,6 @@ cleanup_and_swap(logger *lg, int *r, con
                GDKclrerr();
        for (logged_range *p = lg->pending; p; p = p->next) {
                p->cnt -= cleanup;
-               p->deleted -= cleanup;
        }
        return rcnt;
 }
@@ -1671,7 +1669,7 @@ static gdk_return
 bm_subcommit(logger *lg, logged_range *pending, uint32_t *updated, BUN 
maxupdated)
 {
        BUN cnt = pending ? pending->cnt : BATcount(lg->catalog_bid);
-       BUN dcnt = pending ? pending->deleted : BATcount(lg->dcatalog);
+       BUN dcnt = BATcount(lg->dcatalog);
        BUN p, q;
        BAT *catalog_bid = lg->catalog_bid;
        BAT *catalog_id = lg->catalog_id;
@@ -1712,6 +1710,19 @@ bm_subcommit(logger *lg, logged_range *p
                        cleanup++;
                        if (lids[p] == -1)
                                continue;
+                       if (BUNappend(dcatalog, &(oid){p}, true) != 
GDK_SUCCEED) {
+                               while (BATcount(dcatalog) > dcnt) {
+                                       if (BUNdelete(dcatalog, 
BATcount(dcatalog) - 1) != GDK_SUCCEED) {
+                                               TRC_CRITICAL(WAL, "delete after 
failed append failed\n");
+                                               break;
+                                       }
+                               }
+                               GDKfree(n);
+                               GDKfree(r);
+                               GDKfree(sizes);
+                               log_unlock(lg);
+                               return GDK_FAIL;
+                       }
                }
                TRC_DEBUG(WAL, "new %s (%d)\n", BBP_logical(col), col);
                assert(col);
@@ -1723,7 +1734,7 @@ bm_subcommit(logger *lg, logged_range *p
        n[i++] = catalog_bid->batCacheid;
        sizes[i] = cnt;
        n[i++] = catalog_id->batCacheid;
-       sizes[i] = dcnt;
+       sizes[i] = BATcount(dcatalog);
        n[i++] = dcatalog->batCacheid;
 
        if (cleanup) {
@@ -1738,12 +1749,11 @@ bm_subcommit(logger *lg, logged_range *p
                        return GDK_FAIL;
                }
                cnt -= cleanup;
-               dcnt -= cleanup;
        }
        if (dcatalog != lg->dcatalog) {
                i = subcommit_list_add(i, n, sizes, 
lg->catalog_bid->batCacheid, cnt);
                i = subcommit_list_add(i, n, sizes, lg->catalog_id->batCacheid, 
cnt);
-               i = subcommit_list_add(i, n, sizes, lg->dcatalog->batCacheid, 
dcnt);
+               i = subcommit_list_add(i, n, sizes, lg->dcatalog->batCacheid, 
BATcount(lg->dcatalog));
        }
        if (lg->seqs_id) {
                sizes[i] = BATcount(lg->seqs_id);
@@ -2402,7 +2412,6 @@ log_create(int debug, const char *fn, co
        assert(lg->current == NULL);
        logged_range dummy = {
                .cnt = BATcount(lg->catalog_bid),
-               .deleted = BATcount(lg->dcatalog),
        };
        lg->current = &dummy;
        if (log_open_output(lg) != GDK_SUCCEED) {
@@ -3283,7 +3292,6 @@ static gdk_return
 log_del_bat(logger *lg, log_bid bid)
 {
        BUN p = log_find(lg->catalog_bid, lg->dcatalog, bid);
-       oid pos;
        lng lid = lg->tid;
 
        assert(p != BUN_NONE);
@@ -3292,16 +3300,8 @@ log_del_bat(logger *lg, log_bid bid)
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to