apache / apache/couchdb

Bad Security Object Error After Moving Shards

Open
#1,611 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Erlang
Stars
7k
Forks
1.1k
Avg merge
1d 16h
Merged PRs (30d)
9

Description

Security objects for some databases fail to sync properly in a new node after all shards are moved from an old node.

## Expected Behavior

Security objects for all databases should sync when shards are moved to a new node

## Current Behavior

Security objects for some databases fail to sync properly in a new node after all shards are moved from an old node. The log says things like:

" [error] 2018-09-19T17:24:05.388202Z couchdb@first.couchcluster.internal <0.19944.2> -------- Bad security object in <<"db-name">>: [{{[{<<"_id">>,<<"_security">>},{<<"admins">>,{[{<<"names">>,[]},{<<"roles">>,[]}]}},{<<"members">>,{[{<<"names">>,[<<"user-name">>]},{<<"roles">>,[]}]}}]},13},{{[]},7}] "

## Steps to Reproduce (for bugs)
1. Add a new node to the cluster
2. Move All Shards from an old node to this new one
3. Shut down and delete the old node
4. Verify Security Objects on all databases

## Context

We are trying to replace couch cluster instances with new instances as part of preparing for a scenario where one instance can go away abruptly

## Your Environment

* Version used: Couch 2.1.2, 3 node cluster

Contributor guide

Open the contributing guide

Research direction

Reproduce the three-node CouchDB 2.1.2 scenario by adding a node, moving all shards, deleting the old node, and checking security objects. Start with the reported “Bad security object” log and trace the shard-movement security sync; done means security objects for all databases sync correctly on the new node.

Written by the indexing model from the issue text.

Assessment

Tech stack
erlang
Domain
databases, distributed-systems, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.