canonical / dqlite

Embeddable, replicated and fault-tolerant SQL engine.
https://dqlite.io
Other
3.88k stars 215 forks source link

leader, db: Prevent client from attaching more DBs #440

Closed cole-miller closed 1 year ago

cole-miller commented 1 year ago

Closes #419

Signed-off-by: Cole Miller cole.miller@canonical.com

codecov[bot] commented 1 year ago

Codecov Report

Merging #440 (19cf195) into master (320ea15) will decrease coverage by 0.02%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #440      +/-   ##
==========================================
- Coverage   74.24%   74.21%   -0.03%     
==========================================
  Files          32       32              
  Lines        5378     5380       +2     
  Branches     1680     1682       +2     
==========================================
  Hits         3993     3993              
  Misses        823      823              
- Partials      562      564       +2     
Impacted Files Coverage Δ
src/db.c 53.16% <100.00%> (+0.60%) :arrow_up:
src/leader.c 70.07% <100.00%> (+0.11%) :arrow_up:
src/transport.c 69.28% <0.00%> (-1.31%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

cole-miller commented 1 year ago

I think adding this explicit restriction is the way to go for now -- it's pretty clear that our code is not set up to handle multiple databases on one connection, and we should fail early rather than letting things get far enough to cause database corruption.

MathieuBordere commented 1 year ago

I think adding this explicit restriction is the way to go for now -- it's pretty clear that our code is not set up to handle multiple databases on one connection, and we should fail early rather than letting things get far enough to cause database corruption.

I agree, I'll let it open for a bit in order for other people to chime in.