• Matthew Oliver's avatar
    Sharding: Clean up old CleaveConext's during audit · 81a41da5
    Matthew Oliver authored
    There is a sharding edge case where more CleaveContext are generated and
    stored in the sharding container DB. If this number get's high enough,
    like in the linked bug. If enough CleaveContects build up in the DB then
    this can lead to the 503's when attempting to list the container due to
    all the `X-Container-Sysmeta-Shard-Context-*` headers.
    
    This patch resolves this by tracking the a CleaveContext's last
    modified. And during the sharding audit, any context's that hasn't been
    touched after reclaim_age are deleted.
    
    This plus the skip empty ranges patches should improve these handoff
    shards.
    
    Change-Id: I1e502c328be16fca5f1cca2186b27a0545fecc16
    Closes-Bug: #1843313
    81a41da5
sharder.py 71.6 KB