Commit 6e39f039 authored by zhujiashun's avatar zhujiashun

fix lalb be disabled wrongly

parent 40b13429
...@@ -555,7 +555,7 @@ LocalityAwareLoadBalancer::Weight::~Weight() { ...@@ -555,7 +555,7 @@ LocalityAwareLoadBalancer::Weight::~Weight() {
int64_t LocalityAwareLoadBalancer::Weight::Disable() { int64_t LocalityAwareLoadBalancer::Weight::Disable() {
BAIDU_SCOPED_LOCK(_mutex); BAIDU_SCOPED_LOCK(_mutex);
const int64_t saved = _weight; const int64_t saved = _weight;
_base_weight = 0; _base_weight = -1;
_weight = 0; _weight = 0;
return saved; return saved;
} }
......
...@@ -86,7 +86,7 @@ private: ...@@ -86,7 +86,7 @@ private:
void Describe(std::ostream& os, int64_t now); void Describe(std::ostream& os, int64_t now);
int64_t Disable(); int64_t Disable();
bool Disabled() const { return _base_weight == 0; } bool Disabled() const { return _base_weight == -1; }
int64_t MarkOld(size_t index); int64_t MarkOld(size_t index);
std::pair<int64_t, int64_t> ClearOld(); std::pair<int64_t, int64_t> ClearOld();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment