Skip to content
Viktor Söderqvist edited this page Sep 21, 2020 · 2 revisions

Problems

Application    eredis_cluster    poolboy     eredis                   
   ╷               ╷                ╷           ╷                     
   │               │                │           │                     
   │query          │                │           │                     
   ├──────────────>│ transaction    │           │                     
   │               ├───────────────>│ query     │                     
   │               │                ├──────────>│╶╌╌╌╌╌╌╌╌╌╮          
   │               │                │{error,no_connection} ╎          
   │               │                │<┄┄┄┄┄┄┄┄┄┄┤          ∨          
   │               │<┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┤           │    ╭──────────────╮ 
   │               │ {error,        │           │    │ spawn        │ 
   │               │  no_connection}│           │    │reconnect_loop│ 
   │               │                │           │    ╰──────────────╯ 
   │          ┌┈┈┈┈┴┈┈┈┈┈┈┈┈┈┈┐     │           │          ╷          
   │          ┊refresh_mapping┊     │           │          ╎          
   │          └┈┈┈┈┬┈┈┈┈┈┈┈┈┈┈┘     │           │          ╎          
   │               │                │           │          ╎          
   │               │ transaction    │           │          ╎          
   │               ├───────────────>│ query     │          ╎          
   │               │                ├──────────>│          ╎          
   │               │                │{error,    │          ╎          
   │               │ {error,        │ no_connection}       ╎          
   │               │  no_connection}│<┄┄┄┄┄┄┄┄┄┄┤          ╎          
   │               │<┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┤           │          ╎          
   │          ┌┄┄┄┄┴┄┄┄┄┄┄┄┄┄┄┐     │           │          ╎          
   │          ┆refresh_mapping┆     │           │<╌╌╌╌╌╌╌╌╌╯          
   │          └┄┄┄┄┬┄┄┄┄┄┄┄┄┄┄┘     │           │                     
   ╵               ╵                ╵           ╵                     
  • Eredis returns {error, no_connection} while reconnect is ongoing.
    • Another option would be to let a request block for a while if re-connect is ongoing.
  • Poolboy doesn't know which workers have a working connection and which don't.
    • If we use {strategy, fifo} in the poolboy options, at least we don't get the reconnecting worker over and over.
  • Eredis_cluster handles {error, no_connection} by refreshing the mapping and then trying again. Refreshing the mapping isn't necessary in this case. Is {error, no_connection} used for anything else than this?
Clone this wiki locally