Removed the almost equal comparison and subsequent selection based on historical number of connections. The effect of it was this: Select the server that has historically, weights or not, been slower. Tested this with 2.2 with maxscale on one server and mariadb:s on two servers with different network lags. The tests with historical selects were clearly slower.
		
			
				
	
	
		
			28 lines
		
	
	
		
			689 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			689 B
		
	
	
	
		
			C++
		
	
	
	
	
	
/*
 | 
						|
 * Copyright (c) 2018 MariaDB Corporation Ab
 | 
						|
 *
 | 
						|
 * Use of this software is governed by the Business Source License included
 | 
						|
 * in the LICENSE.TXT file and at www.mariadb.com/bsl11.
 | 
						|
 *
 | 
						|
 * Change Date: 2022-01-01
 | 
						|
 *
 | 
						|
 * On the date above, in accordance with the Business Source License, use
 | 
						|
 * of this software will be governed by version 2 or later of the General
 | 
						|
 * Public License.
 | 
						|
 */
 | 
						|
#pragma once
 | 
						|
 | 
						|
#include <maxscale/ccdefs.hh>
 | 
						|
 | 
						|
#include <string>
 | 
						|
#include <cstdlib>
 | 
						|
 | 
						|
#include <maxscale/server.h>
 | 
						|
 | 
						|
namespace maxscale
 | 
						|
{
 | 
						|
 | 
						|
bool server_set_status(SERVER* server, int bit, std::string* errmsg_out = NULL);
 | 
						|
bool server_clear_status(SERVER* server, int bit, std::string* errmsg_out = NULL);
 | 
						|
}
 |