[SCM] Samba Shared Repository - branch master updated

Martin Schwenke martins at samba.org
Sat Jun 17 14:48:02 UTC 2017


The branch, master has been updated
       via  6ebcba4 ctdb-recovery: Delete empty records during recovery
       via  1a2aef0 ctdb-daemon: Delete empty records from persistent database
      from  bb5c394 s3:smb2_sesssetup: allow a compound request after a SessionSetup

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 6ebcba49d049fccd1b33b35c8802ec3cf80264ac
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Mar 9 15:50:59 2017 +1100

    ctdb-recovery: Delete empty records during recovery
    
    Persistent databases are now always recovered by sequence number.  So
    there is no need to keep the empty records in the database since they
    will never be recovered record-by-record using RSN.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    
    Autobuild-User(master): Martin Schwenke <martins at samba.org>
    Autobuild-Date(master): Sat Jun 17 16:47:55 CEST 2017 on sn-devel-144

commit 1a2aef042e0b13ff7b8c2c6902feca76c4501660
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Mar 9 15:53:21 2017 +1100

    ctdb-daemon: Delete empty records from persistent database
    
    Persistent databases are now always recovered by sequence number.  So
    there is no need to keep the empty records in the database since they
    will never be recovered record-by-record using RSN.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

-----------------------------------------------------------------------

Summary of changes:
 ctdb/server/ctdb_ltdb_server.c     |  2 --
 ctdb/server/ctdb_recovery_helper.c | 33 ++-------------------------------
 2 files changed, 2 insertions(+), 33 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/server/ctdb_ltdb_server.c b/ctdb/server/ctdb_ltdb_server.c
index 677078b..f5a65f3 100644
--- a/ctdb/server/ctdb_ltdb_server.c
+++ b/ctdb/server/ctdb_ltdb_server.c
@@ -104,8 +104,6 @@ static int ctdb_ltdb_store_server(struct ctdb_db_context *ctdb_db,
 		keep = true;
 	} else if (header->flags & CTDB_REC_RO_FLAGS) {
 		keep = true;
-	} else if (ctdb_db->persistent) {
-		keep = true;
 	} else if (header->flags & CTDB_REC_FLAG_AUTOMATIC) {
 		/*
 		 * The record is not created by the client but
diff --git a/ctdb/server/ctdb_recovery_helper.c b/ctdb/server/ctdb_recovery_helper.c
index ab5dccc..b882da0 100644
--- a/ctdb/server/ctdb_recovery_helper.c
+++ b/ctdb/server/ctdb_recovery_helper.c
@@ -220,37 +220,8 @@ static int recbuf_filter_add(struct ctdb_rec_buffer *recbuf, bool persistent,
 	struct ctdb_ltdb_header *header;
 	int ret;
 
-	/*
-	 * skip empty records - but NOT for persistent databases:
-	 *
-	 * The record-by-record mode of recovery deletes empty records.
-	 * For persistent databases, this can lead to data corruption
-	 * by deleting records that should be there:
-	 *
-	 * - Assume the cluster has been running for a while.
-	 *
-	 * - A record R in a persistent database has been created and
-	 *   deleted a couple of times, the last operation being deletion,
-	 *   leaving an empty record with a high RSN, say 10.
-	 *
-	 * - Now a node N is turned off.
-	 *
-	 * - This leaves the local database copy of D on N with the empty
-	 *   copy of R and RSN 10. On all other nodes, the recovery has deleted
-	 *   the copy of record R.
-	 *
-	 * - Now the record is created again while node N is turned off.
-	 *   This creates R with RSN = 1 on all nodes except for N.
-	 *
-	 * - Now node N is turned on again. The following recovery will chose
-	 *   the older empty copy of R due to RSN 10 > RSN 1.
-	 *
-	 * ==> Hence the record is gone after the recovery.
-	 *
-	 * On databases like Samba's registry, this can damage the higher-level
-	 * data structures built from the various tdb-level records.
-	 */
-	if (!persistent && data.dsize <= sizeof(struct ctdb_ltdb_header)) {
+	/* Skip empty records */
+	if (data.dsize <= sizeof(struct ctdb_ltdb_header)) {
 		return 0;
 	}
 


-- 
Samba Shared Repository



More information about the samba-cvs mailing list