[SCM] CTDB repository - branch master updated - ctdb-1.12-224-g7417d99

Ronnie Sahlberg sahlberg at samba.org
Tue Feb 28 22:25:46 MST 2012


The branch, master has been updated
       via  7417d994c2a159f71d27d4bcd2f53684862eece3 (commit)
      from  5ae94c6b9b3000a6c79fccaaea1e007ebd5be1a9 (commit)

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


- Log -----------------------------------------------------------------
commit 7417d994c2a159f71d27d4bcd2f53684862eece3
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Wed Feb 29 16:09:24 2012 +1100

    READONLY: skip vacuuming or deleting records with readonly delegations.
    they are hot. wait until they have been revoked before we recall them.

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

Summary of changes:
 server/ctdb_recover.c |   14 ++++++++++++++
 server/ctdb_vacuum.c  |    6 ++++++
 2 files changed, 20 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/server/ctdb_recover.c b/server/ctdb_recover.c
index 3d56f77..06b5ed1 100644
--- a/server/ctdb_recover.c
+++ b/server/ctdb_recover.c
@@ -954,6 +954,20 @@ static int delete_tdb_record(struct ctdb_context *ctdb, struct ctdb_db_context *
 		return -1;		
 	}
 
+	/* do not allow deleting record that have readonly flags set. */
+	if (hdr->flags & (CTDB_REC_RO_HAVE_DELEGATIONS|CTDB_REC_RO_HAVE_READONLY|CTDB_REC_RO_REVOKING_READONLY|CTDB_REC_RO_REVOKE_COMPLETE)) {
+		tdb_chainunlock(ctdb_db->ltdb->tdb, key);
+		DEBUG(DEBUG_INFO,(__location__ " Skipping record with readonly flags set\n"));
+		free(data.dptr);
+		return -1;		
+	}
+	if (hdr2->flags & (CTDB_REC_RO_HAVE_DELEGATIONS|CTDB_REC_RO_HAVE_READONLY|CTDB_REC_RO_REVOKING_READONLY|CTDB_REC_RO_REVOKE_COMPLETE)) {
+		tdb_chainunlock(ctdb_db->ltdb->tdb, key);
+		DEBUG(DEBUG_INFO,(__location__ " Skipping record with readonly flags set\n"));
+		free(data.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"));
diff --git a/server/ctdb_vacuum.c b/server/ctdb_vacuum.c
index e0e1e3b..b492f9b 100644
--- a/server/ctdb_vacuum.c
+++ b/server/ctdb_vacuum.c
@@ -491,6 +491,12 @@ static int delete_record_traverse(void *param, void *data)
 
 	header = (struct ctdb_ltdb_header *)tdb_data.dptr;
 
+	if (header->flags & (CTDB_REC_RO_HAVE_DELEGATIONS|CTDB_REC_RO_HAVE_READONLY|CTDB_REC_RO_REVOKING_READONLY|CTDB_REC_RO_REVOKE_COMPLETE)) {
+	  /* The record has readonly flags set. skip deleting */
+		vdata->delete_skipped++;
+		goto done;
+	}
+
 	if (header->dmaster != ctdb->pnn) {
 		/* The record has been migrated off the node. Skip. */
 		vdata->delete_skipped++;


-- 
CTDB repository


More information about the samba-cvs mailing list