diff options
Diffstat (limited to 'keyserver/producers')
-rw-r--r-- | keyserver/producers/keychange.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/keyserver/producers/keychange.go b/keyserver/producers/keychange.go index d59dd200..c51d9f55 100644 --- a/keyserver/producers/keychange.go +++ b/keyserver/producers/keychange.go @@ -31,6 +31,15 @@ type KeyChange struct { DB storage.Database } +// DefaultPartition returns the default partition this process is sending key changes to. +// NB: A keyserver MUST send key changes to only 1 partition or else query operations will +// become inconsistent. Partitions can be sharded (e.g by hash of user ID of key change) but +// then all keyservers must be queried to calculate the entire set of key changes between +// two sync tokens. +func (p *KeyChange) DefaultPartition() int32 { + return 0 +} + // ProduceKeyChanges creates new change events for each key func (p *KeyChange) ProduceKeyChanges(keys []api.DeviceKeys) error { for _, key := range keys { |