diff options
author | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2010-12-06 13:08:53 +1100 |
---|---|---|
committer | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2011-02-18 10:14:56 +1100 |
commit | 65f44e159f0f93fbbc5ccc0c6164c853ebe2e850 (patch) | |
tree | b1aae4c74241a8b6c201d636dc5ab263349a29a5 | |
parent | d32a4dd50165f69c1f7bbff15b0bcd2c21fb2a2b (diff) | |
download | samba-65f44e159f0f93fbbc5ccc0c6164c853ebe2e850.tar.gz samba-65f44e159f0f93fbbc5ccc0c6164c853ebe2e850.tar.xz samba-65f44e159f0f93fbbc5ccc0c6164c853ebe2e850.zip |
Add two new flags for the ltdb header.
One of which signals that the record has never been migrated to/from a node
while containing data.
This property "has never been migrated while non-zero" is important later
to provide heuristics on which records we might be able to purge
from the tdb files cheaply, i.e. without having to rely on the full-blown
database vacuum.
These records are belived to be very common and the pattern would look like
this :
1, no record exists at all.
2, client opens a file
3, samba requests the record for this file
4, an empty record is created on the LMASTER
5, the empty record is migrated to the DMASTER
6, samba writes a <sharemode> to the record locally and the record grows
7, client finishes working the file and closes the file
8, samba removes the sharemode and the record becomes empty again.
9, much later : vacuuming will delete the record
At stage 8, since the record has never been migrated onto a node wile being
non-zero it would be safe, and much more efficient to just delete the record
completely from the database and hand it back to the LMASTER.
The flags occupy the same uint32_t as was previously used for laccessor/lacount
in the header. For now, make sure the flags only define/use the top 16 bits
of this field so that we are sure we dont collide with bits set to one
from previous generations of the ctdb cluster database prior to this
change in semantics of this word.
This is a rework of Michaels patch :
commit 2af1a47cbe1a608496c8caf3eb0c990eb7259a0d
Author: Michael Adam <obnox@samba.org>
Date: Tue Nov 30 17:00:54 2010 +0100
add a DEFAULT record flag and a MIGRATED_WITH_DATA record flag.
(This used to be ctdb commit e075670dee8e6ecaba54986f87a85be3d0528b6b)
-rw-r--r-- | ctdb/include/ctdb_protocol.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ctdb/include/ctdb_protocol.h b/ctdb/include/ctdb_protocol.h index 199a1bbfe5..b6b753c3c7 100644 --- a/ctdb/include/ctdb_protocol.h +++ b/ctdb/include/ctdb_protocol.h @@ -480,7 +480,9 @@ struct ctdb_ltdb_header { uint64_t rsn; uint32_t dmaster; uint32_t reserved1; - uint32_t reserved2; +#define CTDB_REC_FLAG_DEFAULT 0x00000000 +#define CTDB_REC_FLAG_MIGRATED_WITH_DATA 0x00010000 + uint32_t flags; }; |