[SCM] CTDB repository - branch 1.0.114 updated - ctdb-1.0.114.6-12-g11a20ec

Michael Adam obnox at samba.org
Thu Aug 29 14:53:35 MDT 2013


The branch, 1.0.114 has been updated
       via  11a20ecbd949bd45410189d7b7e6348b42a9729e (commit)
       via  582131cd39369973100c9ec30492cc1d606e7682 (commit)
      from  00f53a9a8f440be0bc993b1800383cd930fd273e (commit)

http://gitweb.samba.org/?p=ctdb.git;a=shortlog;h=1.0.114


- Log -----------------------------------------------------------------
commit 11a20ecbd949bd45410189d7b7e6348b42a9729e
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Mon Aug 12 15:50:30 2013 +1000

    vacuuming: Fix vacuuming bug where requests keep bouncing between nodes (part 2)
    
    This is caused by corruption of a record header such that the records
    on two nodes point to each other as dmaster.  This makes a request for
    that record bounce between nodes endlessly.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit f0853013655ac3bedf1b793de128fb679c6db6c6)
    
    Conflicts:
    
    	server/ctdb_recover.c

commit 582131cd39369973100c9ec30492cc1d606e7682
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Mon Aug 12 15:51:00 2013 +1000

    vacuuming: Fix vacuuming bug where requests keep bouncing between nodes (part 1)
    
    This is caused by corruption of a record header such that the records
    on two nodes point to each other as dmaster.  This makes a request for
    that record bounce between nodes endlessly.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit a610bc351f0754c84c78c27d02f9a695e60c5b0f)

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

Summary of changes:
 server/ctdb_recover.c |   34 +++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 17 deletions(-)


Changeset truncated at 500 lines:

diff --git a/server/ctdb_recover.c b/server/ctdb_recover.c
index f5fa257..4794e63 100644
--- a/server/ctdb_recover.c
+++ b/server/ctdb_recover.c
@@ -783,7 +783,7 @@ bool ctdb_recovery_lock(struct ctdb_context *ctdb, bool keep)
  */
 static int delete_tdb_record(struct ctdb_context *ctdb, struct ctdb_db_context *ctdb_db, struct ctdb_rec_data *rec)
 {
-	TDB_DATA key, data;
+	TDB_DATA key, data, data2;
 	struct ctdb_ltdb_header *hdr, *hdr2;
 	
 	/* these are really internal tdb functions - but we need them here for
@@ -814,13 +814,13 @@ static int delete_tdb_record(struct ctdb_context *ctdb, struct ctdb_db_context *
 		return -1;
 	}
 
-	data = tdb_fetch(ctdb_db->ltdb->tdb, key);
-	if (data.dptr == NULL) {
+	data2 = tdb_fetch(ctdb_db->ltdb->tdb, key);
+	if (data2.dptr == NULL) {
 		tdb_chainunlock(ctdb_db->ltdb->tdb, key);
 		return 0;
 	}
 
-	if (data.dsize < sizeof(struct ctdb_ltdb_header)) {
+	if (data2.dsize < sizeof(struct ctdb_ltdb_header)) {
 		if (tdb_lock_nonblock(ctdb_db->ltdb->tdb, -1, F_WRLCK) == 0) {
 			if (tdb_delete(ctdb_db->ltdb->tdb, key) != 0) {
 				DEBUG(DEBUG_CRIT,(__location__ " Failed to delete corrupt record\n"));
@@ -829,45 +829,45 @@ static int delete_tdb_record(struct ctdb_context *ctdb, struct ctdb_db_context *
 			DEBUG(DEBUG_CRIT,(__location__ " Deleted corrupt record\n"));
 		}
 		tdb_chainunlock(ctdb_db->ltdb->tdb, key);
-		free(data.dptr);
+		free(data2.dptr);
 		return 0;
 	}
 	
-	hdr2 = (struct ctdb_ltdb_header *)data.dptr;
+	hdr2 = (struct ctdb_ltdb_header *)data2.dptr;
 
 	if (hdr2->rsn > hdr->rsn) {
 		tdb_chainunlock(ctdb_db->ltdb->tdb, key);
 		DEBUG(DEBUG_INFO,(__location__ " Skipping record with rsn=%llu - called with rsn=%llu\n",
 			 (unsigned long long)hdr2->rsn, (unsigned long long)hdr->rsn));
-		free(data.dptr);
-		return -1;		
+		free(data2.dptr);
+		return -1;
 	}
 
 	if (hdr2->dmaster == ctdb->pnn) {
 		tdb_chainunlock(ctdb_db->ltdb->tdb, key);
 		DEBUG(DEBUG_INFO,(__location__ " Attempted delete record where we are the dmaster\n"));
-		free(data.dptr);
-		return -1;				
+		free(data2.dptr);
+		return -1;
 	}
 
 	if (tdb_lock_nonblock(ctdb_db->ltdb->tdb, -1, F_WRLCK) != 0) {
 		tdb_chainunlock(ctdb_db->ltdb->tdb, key);
-		free(data.dptr);
-		return -1;				
+		free(data2.dptr);
+		return -1;
 	}
 
 	if (tdb_delete(ctdb_db->ltdb->tdb, key) != 0) {
 		tdb_unlock(ctdb_db->ltdb->tdb, -1, F_WRLCK);
 		tdb_chainunlock(ctdb_db->ltdb->tdb, key);
 		DEBUG(DEBUG_INFO,(__location__ " Failed to delete record\n"));
-		free(data.dptr);
-		return -1;						
+		free(data2.dptr);
+		return -1;
 	}
 
 	tdb_unlock(ctdb_db->ltdb->tdb, -1, F_WRLCK);
 	tdb_chainunlock(ctdb_db->ltdb->tdb, key);
-	free(data.dptr);
-	return 0;	
+	free(data2.dptr);
+	return 0;
 }
 
 
@@ -1132,7 +1132,7 @@ static int store_tdb_record(struct ctdb_context *ctdb,
 		goto done;
 	}
 
-	hdr2 = (struct ctdb_ltdb_header *)data.dptr;
+	hdr2 = (struct ctdb_ltdb_header *)data2.dptr;
 
 	if (hdr2->rsn > hdr->rsn) {
 		DEBUG(DEBUG_INFO, (__location__ " Skipping record with "


-- 
CTDB repository


More information about the samba-cvs mailing list