function memcached_behavior_set_distribution()

Bug #1009509 reported by ping,cai
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libmemcached
Fix Released
Medium
Brian Aker

Bug Description

memcached_return_t memcached_behavior_set_distribution(memcached_st *ptr, memcached_server_distribution_t type)
{
  if (type < MEMCACHED_DISTRIBUTION_CONSISTENT_MAX)
  {
    if (MEMCACHED_DISTRIBUTION_CONSISTENT_WEIGHTED) // is here wrong??
    {
      ptr->ketama.weighted= true;
    }
    else
    {
      ptr->ketama.weighted= false;
    }

    ptr->distribution= type;
    return run_distribution(ptr);
  }

  return memcached_set_error(*ptr, MEMCACHED_INVALID_ARGUMENTS, MEMCACHED_AT,
                             memcached_literal_param("Invalid memcached_server_distribution_t"));
}

should if (MEMCACHED_DISTRIBUTION_CONSISTENT_WEIGHTED)
 be if (type == MEMCACHED_DISTRIBUTION_CONSISTENT_WEIGHTED)

Revision history for this message
Brian Aker (brianaker) wrote : Re: [Bug 1009509] [NEW] function memcached_behavior_set_distribution()

Hi,

On Jun 6, 2012, at 2:27 PM, ping,cai wrote:

> if (MEMCACHED_DISTRIBUTION_CONSISTENT_WEIGHTED) // is here wrong??

All weights are set to be the same by default, so while the above is a bug,… behavior is identical.

Cheers,
 -Brian

Revision history for this message
Brian Aker (brianaker) wrote :

Fixed in 1.0.9

Changed in libmemcached:
assignee: nobody → Brian Aker (brianaker)
importance: Undecided → Medium
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.