完善查询
This commit is contained in:
27
app.py
27
app.py
@@ -906,9 +906,11 @@ def execute_mixed_query(pro_session, test_session, pro_config, test_config, keys
|
||||
|
||||
# 处理生产环境查询
|
||||
if sharding_config.get('use_sharding_for_pro', False):
|
||||
# 获取生产环境分表配置参数,优先使用专用参数,否则使用通用参数
|
||||
pro_interval = sharding_config.get('pro_interval_seconds') or sharding_config.get('interval_seconds', 604800)
|
||||
pro_table_count = sharding_config.get('pro_table_count') or sharding_config.get('table_count', 14)
|
||||
|
||||
# 记录生产环境分表配置信息
|
||||
pro_interval = sharding_config.get('pro_interval_seconds', 604800)
|
||||
pro_table_count = sharding_config.get('pro_table_count', 14)
|
||||
logger.info(f"=== 生产环境分表配置 ===")
|
||||
logger.info(f"启用分表查询: True")
|
||||
logger.info(f"时间间隔: {pro_interval}秒 ({pro_interval//86400}天)")
|
||||
@@ -954,9 +956,11 @@ def execute_mixed_query(pro_session, test_session, pro_config, test_config, keys
|
||||
|
||||
# 处理测试环境查询
|
||||
if sharding_config.get('use_sharding_for_test', False):
|
||||
# 获取测试环境分表配置参数,优先使用专用参数,否则使用通用参数
|
||||
test_interval = sharding_config.get('test_interval_seconds') or sharding_config.get('interval_seconds', 604800)
|
||||
test_table_count = sharding_config.get('test_table_count') or sharding_config.get('table_count', 14)
|
||||
|
||||
# 记录测试环境分表配置信息
|
||||
test_interval = sharding_config.get('test_interval_seconds', 604800)
|
||||
test_table_count = sharding_config.get('test_table_count', 14)
|
||||
logger.info(f"=== 测试环境分表配置 ===")
|
||||
logger.info(f"启用分表查询: True")
|
||||
logger.info(f"时间间隔: {test_interval}秒 ({test_interval//86400}天)")
|
||||
@@ -980,8 +984,8 @@ def execute_mixed_query(pro_session, test_session, pro_config, test_config, keys
|
||||
results['test_data'] = test_data
|
||||
results['sharding_info']['test_shards'] = {
|
||||
'enabled': True,
|
||||
'interval_seconds': sharding_config.get('test_interval_seconds', 604800),
|
||||
'table_count': sharding_config.get('test_table_count', 14),
|
||||
'interval_seconds': test_interval,
|
||||
'table_count': test_table_count,
|
||||
'queried_tables': test_queried_tables,
|
||||
'error_tables': test_error_tables,
|
||||
'failed_keys': test_failed_keys
|
||||
@@ -1214,7 +1218,16 @@ def sharding_query_compare():
|
||||
logger.info(f" values数量: {len(values)}")
|
||||
logger.info(f" fields_to_compare: {fields_to_compare}")
|
||||
logger.info(f" exclude_fields: {exclude_fields}")
|
||||
logger.info(f" sharding_config: {sharding_config}")
|
||||
logger.info(f" sharding_config原始数据: {sharding_config}")
|
||||
logger.info(f" sharding_config具体参数:")
|
||||
logger.info(f" use_sharding_for_pro: {sharding_config.get('use_sharding_for_pro')}")
|
||||
logger.info(f" use_sharding_for_test: {sharding_config.get('use_sharding_for_test')}")
|
||||
logger.info(f" pro_interval_seconds: {sharding_config.get('pro_interval_seconds')}")
|
||||
logger.info(f" pro_table_count: {sharding_config.get('pro_table_count')}")
|
||||
logger.info(f" test_interval_seconds: {sharding_config.get('test_interval_seconds')}")
|
||||
logger.info(f" test_table_count: {sharding_config.get('test_table_count')}")
|
||||
logger.info(f" interval_seconds: {sharding_config.get('interval_seconds')}")
|
||||
logger.info(f" table_count: {sharding_config.get('table_count')}")
|
||||
|
||||
logger.info(f"分表查询配置:{len(values)}个key值,生产表:{pro_config['table']},测试表:{test_config['table']}")
|
||||
|
||||
|
Reference in New Issue
Block a user