-
Notifications
You must be signed in to change notification settings - Fork 14
feat: update the pool options to match the design #1089
Conversation
* `max_sessions` is now `max_sessions_per_channel` * we're not going to be using `write_sessions_fraction`, so remove it. Part of #307
Codecov Report
@@ Coverage Diff @@
## master #1089 +/- ##
==========================================
+ Coverage 91.6% 91.67% +0.07%
==========================================
Files 164 164
Lines 12116 12171 +55
==========================================
+ Hits 11099 11158 +59
+ Misses 1017 1013 -4
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @devbww, @devjgm, and @mr-salty)
google/cloud/spanner/internal/session_pool.h, line 53 at r1 (raw file):
// The maximum number of sessions to create on each channel. // Values <= 1 are treated as 1. // The `max_sessions_per_channel` limit takes precedence over `min_sessions`.
FYI: I had to read the implementation and this comment like 3 times before I could figure out what "take precedence" meant. At first I thought it mean "the number of sessions can be smaller than min_sessions
if max_sessions_per_channel*num_channels < min_session
"? But I think it means (the current implementation) "min_sessions
can never be smaller than max_sessions_per_channel * num_channels
"
google/cloud/spanner/internal/session_pool.h, line 144 at r1 (raw file):
std::unique_ptr<BackoffPolicy const> backoff_policy_prototype_; SessionPoolOptions const options_; const int max_pool_size_;
s/const int/int const/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @coryan, @devbww, and @devjgm)
google/cloud/spanner/internal/session_pool.h, line 53 at r1 (raw file):
Previously, coryan (Carlos O'Ryan) wrote…
FYI: I had to read the implementation and this comment like 3 times before I could figure out what "take precedence" meant. At first I thought it mean "the number of sessions can be smaller than
min_sessions
ifmax_sessions_per_channel*num_channels < min_session
"? But I think it means (the current implementation) "min_sessions
can never be smaller thanmax_sessions_per_channel * num_channels
"
I reworded it; hopefully it's clearer. It means min_sessions
can never be larger than max_sessions_per_channel
* num_channels
google/cloud/spanner/internal/session_pool.h, line 144 at r1 (raw file):
Previously, coryan (Carlos O'Ryan) wrote…
s/const int/int const/
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r2.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @devbww and @devjgm)
…cloud-cpp-spanner#1089) * `max_sessions` is now `max_sessions_per_channel` * we're not going to be using `write_sessions_fraction`, so remove it. Part of googleapis/google-cloud-cpp-spanner#307
max_sessions
is nowmax_sessions_per_channel
write_sessions_fraction
, so remove it.Note I also flipped the precedence of
min_sessions
and (max_sessions_per_channel
* the number of channels) - the latter now takes precedence, just for simplicity; I don't think it matters that much because it's a misconfiguration.Part of #307
This change is