summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ctdb/server/ctdb_recover.c14
-rw-r--r--ctdb/server/ctdb_vacuum.c6
2 files changed, 20 insertions, 0 deletions
diff --git a/ctdb/server/ctdb_recover.c b/ctdb/server/ctdb_recover.c
index 3d56f77d6c..06b5ed1a92 100644
--- a/ctdb/server/ctdb_recover.c
+++ b/ctdb/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/ctdb/server/ctdb_vacuum.c b/ctdb/server/ctdb_vacuum.c
index e0e1e3b508..b492f9b899 100644
--- a/ctdb/server/ctdb_vacuum.c
+++ b/ctdb/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++;