Hello community,

here is the log from the commit of package tdb for openSUSE:Factory checked in 
at 2015-01-21 21:55:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/tdb (Old)
 and      /work/SRC/openSUSE:Factory/.tdb.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "tdb"

Changes:
--------
--- /work/SRC/openSUSE:Factory/tdb/tdb.changes  2014-12-23 11:48:48.000000000 
+0100
+++ /work/SRC/openSUSE:Factory/.tdb.new/tdb.changes     2015-01-21 
21:56:21.000000000 +0100
@@ -1,0 +2,8 @@
+Tue Jan 13 14:50:54 UTC 2015 - [email protected]
+
+- Update to version 1.3.4.
+  + toos: allow transactions with TDB_MUTEX_LOCKING
+  + test: add tdb1-run-mutex-transaction1 test
+  + allow transactions on on tdb's with TDB_MUTEX_LOCKING
+
+-------------------------------------------------------------------

Old:
----
  tdb-1.3.3.tar.asc
  tdb-1.3.3.tar.gz

New:
----
  tdb-1.3.4.tar.asc
  tdb-1.3.4.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ tdb.spec ++++++
--- /var/tmp/diff_new_pack.XftU3D/_old  2015-01-21 21:56:21.000000000 +0100
+++ /var/tmp/diff_new_pack.XftU3D/_new  2015-01-21 21:56:21.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package tdb
 #
-# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -34,7 +34,7 @@
 %endif
 BuildRequires:  python-devel
 Url:            http://tdb.samba.org/
-Version:        1.3.3
+Version:        1.3.4
 Release:        0
 Summary:        Samba Trivial Database
 License:        GPL-3.0+

++++++ build_pie.patch ++++++
--- /var/tmp/diff_new_pack.XftU3D/_old  2015-01-21 21:56:21.000000000 +0100
+++ /var/tmp/diff_new_pack.XftU3D/_new  2015-01-21 21:56:21.000000000 +0100
@@ -7,7 +7,7 @@
 ===================================================================
 --- tdb-1.2.12.orig/wscript
 +++ tdb-1.2.12/wscript
-@@ -149,20 +149,27 @@ def build(bld):
+@@ -150,20 +150,27 @@ def build(bld):
  
          bld.SAMBA_BINARY('tdbrestore',
                           'tools/tdbrestore.c',

++++++ tdb-1.3.3.tar.gz -> tdb-1.3.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tdb-1.3.3/ABI/tdb-1.3.4.sigs 
new/tdb-1.3.4/ABI/tdb-1.3.4.sigs
--- old/tdb-1.3.3/ABI/tdb-1.3.4.sigs    1970-01-01 01:00:00.000000000 +0100
+++ new/tdb-1.3.4/ABI/tdb-1.3.4.sigs    2014-12-22 09:14:32.000000000 +0100
@@ -0,0 +1,68 @@
+tdb_add_flags: void (struct tdb_context *, unsigned int)
+tdb_append: int (struct tdb_context *, TDB_DATA, TDB_DATA)
+tdb_chainlock: int (struct tdb_context *, TDB_DATA)
+tdb_chainlock_mark: int (struct tdb_context *, TDB_DATA)
+tdb_chainlock_nonblock: int (struct tdb_context *, TDB_DATA)
+tdb_chainlock_read: int (struct tdb_context *, TDB_DATA)
+tdb_chainlock_unmark: int (struct tdb_context *, TDB_DATA)
+tdb_chainunlock: int (struct tdb_context *, TDB_DATA)
+tdb_chainunlock_read: int (struct tdb_context *, TDB_DATA)
+tdb_check: int (struct tdb_context *, int (*)(TDB_DATA, TDB_DATA, void *), 
void *)
+tdb_close: int (struct tdb_context *)
+tdb_delete: int (struct tdb_context *, TDB_DATA)
+tdb_dump_all: void (struct tdb_context *)
+tdb_enable_seqnum: void (struct tdb_context *)
+tdb_error: enum TDB_ERROR (struct tdb_context *)
+tdb_errorstr: const char *(struct tdb_context *)
+tdb_exists: int (struct tdb_context *, TDB_DATA)
+tdb_fd: int (struct tdb_context *)
+tdb_fetch: TDB_DATA (struct tdb_context *, TDB_DATA)
+tdb_firstkey: TDB_DATA (struct tdb_context *)
+tdb_freelist_size: int (struct tdb_context *)
+tdb_get_flags: int (struct tdb_context *)
+tdb_get_logging_private: void *(struct tdb_context *)
+tdb_get_seqnum: int (struct tdb_context *)
+tdb_hash_size: int (struct tdb_context *)
+tdb_increment_seqnum_nonblock: void (struct tdb_context *)
+tdb_jenkins_hash: unsigned int (TDB_DATA *)
+tdb_lock_nonblock: int (struct tdb_context *, int, int)
+tdb_lockall: int (struct tdb_context *)
+tdb_lockall_mark: int (struct tdb_context *)
+tdb_lockall_nonblock: int (struct tdb_context *)
+tdb_lockall_read: int (struct tdb_context *)
+tdb_lockall_read_nonblock: int (struct tdb_context *)
+tdb_lockall_unmark: int (struct tdb_context *)
+tdb_log_fn: tdb_log_func (struct tdb_context *)
+tdb_map_size: size_t (struct tdb_context *)
+tdb_name: const char *(struct tdb_context *)
+tdb_nextkey: TDB_DATA (struct tdb_context *, TDB_DATA)
+tdb_null: dptr = 0xXXXX, dsize = 0
+tdb_open: struct tdb_context *(const char *, int, int, int, mode_t)
+tdb_open_ex: struct tdb_context *(const char *, int, int, int, mode_t, const 
struct tdb_logging_context *, tdb_hash_func)
+tdb_parse_record: int (struct tdb_context *, TDB_DATA, int (*)(TDB_DATA, 
TDB_DATA, void *), void *)
+tdb_printfreelist: int (struct tdb_context *)
+tdb_remove_flags: void (struct tdb_context *, unsigned int)
+tdb_reopen: int (struct tdb_context *)
+tdb_reopen_all: int (int)
+tdb_repack: int (struct tdb_context *)
+tdb_rescue: int (struct tdb_context *, void (*)(TDB_DATA, TDB_DATA, void *), 
void *)
+tdb_runtime_check_for_robust_mutexes: bool (void)
+tdb_set_logging_function: void (struct tdb_context *, const struct 
tdb_logging_context *)
+tdb_set_max_dead: void (struct tdb_context *, int)
+tdb_setalarm_sigptr: void (struct tdb_context *, volatile sig_atomic_t *)
+tdb_store: int (struct tdb_context *, TDB_DATA, TDB_DATA, int)
+tdb_summary: char *(struct tdb_context *)
+tdb_transaction_cancel: int (struct tdb_context *)
+tdb_transaction_commit: int (struct tdb_context *)
+tdb_transaction_prepare_commit: int (struct tdb_context *)
+tdb_transaction_start: int (struct tdb_context *)
+tdb_transaction_start_nonblock: int (struct tdb_context *)
+tdb_transaction_write_lock_mark: int (struct tdb_context *)
+tdb_transaction_write_lock_unmark: int (struct tdb_context *)
+tdb_traverse: int (struct tdb_context *, tdb_traverse_func, void *)
+tdb_traverse_read: int (struct tdb_context *, tdb_traverse_func, void *)
+tdb_unlock: int (struct tdb_context *, int, int)
+tdb_unlockall: int (struct tdb_context *)
+tdb_unlockall_read: int (struct tdb_context *)
+tdb_validate_freelist: int (struct tdb_context *, int *)
+tdb_wipe_all: int (struct tdb_context *)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tdb-1.3.3/common/transaction.c 
new/tdb-1.3.4/common/transaction.c
--- old/tdb-1.3.3/common/transaction.c  2014-09-16 20:04:31.000000000 +0200
+++ new/tdb-1.3.4/common/transaction.c  2014-12-22 09:14:32.000000000 +0100
@@ -421,7 +421,7 @@
                                  enum tdb_lock_flags lockflags)
 {
        /* some sanity checks */
-       if (tdb->read_only || (tdb->flags & (TDB_INTERNAL|TDB_MUTEX_LOCKING))
+       if (tdb->read_only || (tdb->flags & TDB_INTERNAL)
            || tdb->traverse_read) {
                TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_transaction_start: cannot 
start a transaction on a read-only or internal db\n"));
                tdb->ecode = TDB_ERR_EINVAL;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tdb-1.3.3/test/run-mutex-transaction1.c 
new/tdb-1.3.4/test/run-mutex-transaction1.c
--- old/tdb-1.3.3/test/run-mutex-transaction1.c 1970-01-01 01:00:00.000000000 
+0100
+++ new/tdb-1.3.4/test/run-mutex-transaction1.c 2014-12-22 09:14:32.000000000 
+0100
@@ -0,0 +1,236 @@
+#include "../common/tdb_private.h"
+#include "../common/io.c"
+#include "../common/tdb.c"
+#include "../common/lock.c"
+#include "../common/freelist.c"
+#include "../common/traverse.c"
+#include "../common/transaction.c"
+#include "../common/error.c"
+#include "../common/open.c"
+#include "../common/check.c"
+#include "../common/hash.c"
+#include "../common/mutex.c"
+#include "tap-interface.h"
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <stdarg.h>
+
+static TDB_DATA key, data;
+
+static void log_fn(struct tdb_context *tdb, enum tdb_debug_level level,
+                  const char *fmt, ...)
+{
+       va_list ap;
+       va_start(ap, fmt);
+       vfprintf(stderr, fmt, ap);
+       va_end(ap);
+}
+
+static int do_child(int tdb_flags, int to, int from)
+{
+       struct tdb_context *tdb;
+       unsigned int log_count;
+       struct tdb_logging_context log_ctx = { log_fn, &log_count };
+       int ret;
+       char c = 0;
+
+       tdb = tdb_open_ex("mutex-transaction1.tdb", 3, tdb_flags,
+                         O_RDWR|O_CREAT, 0755, &log_ctx, NULL);
+       ok(tdb, "tdb_open_ex should succeed");
+
+       ret = tdb_transaction_start(tdb);
+       ok(ret == 0, "tdb_transaction_start should succeed");
+
+       ret = tdb_store(tdb, key, data, TDB_INSERT);
+       ok(ret == 0, "tdb_store(tdb, key, data, TDB_INSERT) should succeed");
+
+       write(to, &c, sizeof(c));
+       read(from, &c, sizeof(c));
+
+       ret = tdb_transaction_cancel(tdb);
+       ok(ret == 0, "tdb_transaction_cancel should succeed");
+
+       write(to, &c, sizeof(c));
+       read(from, &c, sizeof(c));
+
+       ret = tdb_transaction_start(tdb);
+       ok(ret == 0, "tdb_transaction_start should succeed");
+
+       ret = tdb_store(tdb, key, data, TDB_INSERT);
+       ok(ret == 0, "tdb_store(tdb, key, data, TDB_INSERT) should succeed");
+
+       write(to, &c, sizeof(c));
+       read(from, &c, sizeof(c));
+
+       ret = tdb_transaction_commit(tdb);
+       ok(ret == 0, "tdb_transaction_commit should succeed");
+
+       write(to, &c, sizeof(c));
+       read(from, &c, sizeof(c));
+
+       ret = tdb_transaction_start(tdb);
+       ok(ret == 0, "tdb_transaction_start should succeed");
+
+       ret = tdb_store(tdb, key, key, TDB_REPLACE);
+       ok(ret == 0, "tdb_store(tdb, key, data, TDB_REPLACE) should succeed");
+
+       write(to, &c, sizeof(c));
+       read(from, &c, sizeof(c));
+
+       ret = tdb_transaction_commit(tdb);
+       ok(ret == 0, "tdb_transaction_commit should succeed");
+
+       write(to, &c, sizeof(c));
+       read(from, &c, sizeof(c));
+
+       return 0;
+}
+
+/* The code should barf on TDBs created with rwlocks. */
+int main(int argc, char *argv[])
+{
+       struct tdb_context *tdb;
+       unsigned int log_count;
+       struct tdb_logging_context log_ctx = { log_fn, &log_count };
+       int ret, status;
+       pid_t child, wait_ret;
+       int fromchild[2];
+       int tochild[2];
+       TDB_DATA val;
+       char c;
+       int tdb_flags;
+       bool runtime_support;
+
+       runtime_support = tdb_runtime_check_for_robust_mutexes();
+
+       if (!runtime_support) {
+               skip(1, "No robust mutex support");
+               return exit_status();
+       }
+
+       key.dsize = strlen("hi");
+       key.dptr = discard_const_p(uint8_t, "hi");
+       data.dsize = strlen("world");
+       data.dptr = discard_const_p(uint8_t, "world");
+
+       pipe(fromchild);
+       pipe(tochild);
+
+       tdb_flags = TDB_INCOMPATIBLE_HASH|
+               TDB_MUTEX_LOCKING|
+               TDB_CLEAR_IF_FIRST;
+
+       child = fork();
+       if (child == 0) {
+               close(fromchild[0]);
+               close(tochild[1]);
+               return do_child(tdb_flags, fromchild[1], tochild[0]);
+       }
+       close(fromchild[1]);
+       close(tochild[0]);
+
+       read(fromchild[0], &c, sizeof(c));
+
+       tdb = tdb_open_ex("mutex-transaction1.tdb", 0,
+                         tdb_flags, O_RDWR|O_CREAT, 0755,
+                         &log_ctx, NULL);
+       ok(tdb, "tdb_open_ex should succeed");
+
+       /*
+        * The child has the transaction running
+        */
+       ret = tdb_transaction_start_nonblock(tdb);
+       ok(ret == -1, "tdb_transaction_start_nonblock not succeed");
+
+       ret = tdb_chainlock_nonblock(tdb, key);
+       ok(ret == -1, "tdb_chainlock_nonblock should not succeed");
+
+       /*
+        * We can still read
+        */
+       ret = tdb_exists(tdb, key);
+       ok(ret == 0, "tdb_exists(tdb, key) should return 0");
+
+       val = tdb_fetch(tdb, key);
+       ok(val.dsize == 0, "tdb_fetch(tdb, key) should return an empty value");
+
+       write(tochild[1], &c, sizeof(c));
+
+       /*
+        * When the child canceled we can start...
+        */
+       ret = tdb_transaction_start(tdb);
+       ok(ret == 0, "tdb_transaction_start should succeed");
+
+       read(fromchild[0], &c, sizeof(c));
+       write(tochild[1], &c, sizeof(c));
+
+       ret = tdb_transaction_cancel(tdb);
+       ok(ret == 0, "tdb_transaction_cancel should succeed");
+
+       /*
+        * When we canceled the child can start and store...
+        */
+       read(fromchild[0], &c, sizeof(c));
+
+       /*
+        * We still see the old values before the child commits...
+        */
+       ret = tdb_exists(tdb, key);
+       ok(ret == 0, "tdb_exists(tdb, key) should return 0");
+
+       val = tdb_fetch(tdb, key);
+       ok(val.dsize == 0, "tdb_fetch(tdb, key) should return an empty value");
+
+       write(tochild[1], &c, sizeof(c));
+       read(fromchild[0], &c, sizeof(c));
+
+       /*
+        * We see the new values after the commit...
+        */
+       ret = tdb_exists(tdb, key);
+       ok(ret == 1, "tdb_exists(tdb, key) should return 1");
+
+       val = tdb_fetch(tdb, key);
+       ok(val.dsize != 0, "tdb_fetch(tdb, key) should return a value");
+       ok(val.dsize == data.dsize, "tdb_fetch(tdb, key) should return a 
value");
+       ok(memcmp(val.dptr, data.dptr, data.dsize) == 0, "tdb_fetch(tdb, key) 
should return a value");
+
+       write(tochild[1], &c, sizeof(c));
+       read(fromchild[0], &c, sizeof(c));
+
+       /*
+        * The child started a new transaction and replaces the value,
+        * but we still see the old values before the child commits...
+        */
+       ret = tdb_exists(tdb, key);
+       ok(ret == 1, "tdb_exists(tdb, key) should return 1");
+
+       val = tdb_fetch(tdb, key);
+       ok(val.dsize != 0, "tdb_fetch(tdb, key) should return a value");
+       ok(val.dsize == data.dsize, "tdb_fetch(tdb, key) should return a 
value");
+       ok(memcmp(val.dptr, data.dptr, data.dsize) == 0, "tdb_fetch(tdb, key) 
should return a value");
+
+       write(tochild[1], &c, sizeof(c));
+       read(fromchild[0], &c, sizeof(c));
+
+       /*
+        * We see the new values after the commit...
+        */
+       ret = tdb_exists(tdb, key);
+       ok(ret == 1, "tdb_exists(tdb, key) should return 1");
+
+       val = tdb_fetch(tdb, key);
+       ok(val.dsize != 0, "tdb_fetch(tdb, key) should return a value");
+       ok(val.dsize == key.dsize, "tdb_fetch(tdb, key) should return a value");
+       ok(memcmp(val.dptr, key.dptr, key.dsize) == 0, "tdb_fetch(tdb, key) 
should return a value");
+
+       write(tochild[1], &c, sizeof(c));
+
+       wait_ret = wait(&status);
+       ok(wait_ret == child, "child should have exited correctly");
+
+       diag("done");
+       return exit_status();
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tdb-1.3.3/tools/tdbtorture.c 
new/tdb-1.3.4/tools/tdbtorture.c
--- old/tdb-1.3.3/tools/tdbtorture.c    2014-09-16 20:04:31.000000000 +0200
+++ new/tdb-1.3.4/tools/tdbtorture.c    2014-12-22 09:14:32.000000000 +0100
@@ -120,7 +120,6 @@
 
 #if TRANSACTION_PROB
        if (in_transaction == 0 &&
-           ((tdb_get_flags(db) & TDB_MUTEX_LOCKING) == 0) &&
            (always_transaction || random() % TRANSACTION_PROB == 0)) {
                if (tdb_transaction_start(db) != 0) {
                        fatal("tdb_transaction_start failed");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tdb-1.3.3/wscript new/tdb-1.3.4/wscript
--- old/tdb-1.3.3/wscript       2014-12-02 09:30:09.000000000 +0100
+++ new/tdb-1.3.4/wscript       2014-12-22 09:14:32.000000000 +0100
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 APPNAME = 'tdb'
-VERSION = '1.3.3'
+VERSION = '1.3.4'
 
 blddir = 'bin'
 
@@ -46,6 +46,7 @@
     'run-mutex-allrecord-bench',
     'run-mutex-allrecord-trylock',
     'run-mutex-allrecord-block',
+    'run-mutex-transaction1',
     'run-mutex-die',
     'run-mutex1',
 ]


-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to