summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2014-06-09 13:45:43 +0100
committerSimon MacMullen <simon@rabbitmq.com>2014-06-09 13:45:43 +0100
commita534dc355037d373aaf0b63215beae6775173bf9 (patch)
tree3997dcd5a5cdf390242e9346121898b51e0a7dd2 /include
parent856524f258638e1b22381dea6c08b3fc3ff49799 (diff)
downloadrabbitmq-server-a534dc355037d373aaf0b63215beae6775173bf9.tar.gz
Make decorators field in exchange and queue transient, i.e. we recalcualte it on recovery in case plugins have changed. Also document a bit more clearly what the lifecycle is of the different fields in these records since that area is becoming confusing.
Diffstat (limited to 'include')
-rw-r--r--include/rabbit.hrl23
1 files changed, 17 insertions, 6 deletions
diff --git a/include/rabbit.hrl b/include/rabbit.hrl
index 5ac3197e..a0e96d87 100644
--- a/include/rabbit.hrl
+++ b/include/rabbit.hrl
@@ -39,13 +39,24 @@
-record(resource, {virtual_host, kind, name}).
--record(exchange, {name, type, durable, auto_delete, internal, arguments,
- scratches, policy, decorators}).
--record(exchange_serial, {name, next}).
+%% fields described as 'transient' here are cleared when writing to
+%% rabbit_durable_<thing>
+-record(exchange, {
+ name, type, durable, auto_delete, internal, arguments, %% immutable
+ scratches, %% durable, explicitly updated via update_scratch/3
+ policy, %% durable, implicitly updated when policy changes
+ decorators}). %% transient, recalculated in store/1 (i.e. recovery)
+
+-record(amqqueue, {
+ name, durable, auto_delete, exclusive_owner = none, %% immutable
+ arguments, %% immutable
+ pid, %% durable (just so we know home node)
+ slave_pids, sync_slave_pids, %% transient
+ policy, %% durable, implicit update as above
+ gm_pids, %% transient
+ decorators}). %% transient, recalculated as above
--record(amqqueue, {name, durable, auto_delete, exclusive_owner = none,
- arguments, pid, slave_pids, sync_slave_pids, policy,
- gm_pids, decorators}).
+-record(exchange_serial, {name, next}).
%% mnesia doesn't like unary records, so we add a dummy 'value' field
-record(route, {binding, value = const}).