[PR #23632] Fix ClickZetta stability and reduce logging noise #30329

Closed
opened 2026-02-21 20:47:17 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/23632

State: closed
Merged: Yes


Fix ClickZetta stability and reduce logging noise

🐛 Problem

ClickZetta vector database had two main issues:

  1. Stability: "table or view not found" errors causing crashes during cleanup operations
  2. Logging noise: Excessive config logs flooding the output with setting config: 'cz.sql.job.fast.mode' = 'true' messages

close https://github.com/langgenius/dify/issues/23638

Solution

Core Fixes:

  1. Enhanced error handling for table operations

    • Added graceful handling for ClickZetta-specific error codes (CZLH-42000, "semantic analysis exception")
    • Methods now return empty results instead of crashing when tables don't exist
    • Added connection retry logic with exponential backoff
  2. Suppressed noisy ClickZetta client logs

    • Temporarily set ClickZetta client logger to WARNING level during SET statement execution
    • Reduced our own log verbosity (info → debug) for routine operations
    • Applied to all locations where SET statements are executed

Files Changed:

  • api/core/rag/datasource/vdb/clickzetta/clickzetta_vector.py - Enhanced error handling and reduced logging

🧪 Testing

  • Verified table existence checks handle missing tables gracefully
  • Confirmed connection retry logic works with network issues
  • Validated log noise reduction while maintaining essential debugging info
  • Tested all vector operations continue working normally

📊 Technical Details

Before: Crashes on missing tables, excessive logging noise
After: Graceful degradation, clean logs, improved reliability

Key changes:

  • Enhanced _table_exists() to handle ClickZetta error patterns
  • Added connection retry with exponential backoff in _init_connection()
  • Suppressed ClickZetta client logging during config operations
  • Added table existence checks to all query methods

🎯 Impact

  • Eliminates ClickZetta crashes during dataset cleanup
  • Reduces log noise significantly
  • Improves overall ClickZetta stability
  • No breaking changes or performance impact

Ready for Review 🚀

**Original Pull Request:** https://github.com/langgenius/dify/pull/23632 **State:** closed **Merged:** Yes --- # Fix ClickZetta stability and reduce logging noise ## 🐛 Problem ClickZetta vector database had two main issues: 1. **Stability**: "table or view not found" errors causing crashes during cleanup operations 2. **Logging noise**: Excessive config logs flooding the output with `setting config: 'cz.sql.job.fast.mode' = 'true'` messages close https://github.com/langgenius/dify/issues/23638 ## ✅ Solution ### **Core Fixes**: 1. **Enhanced error handling for table operations** - Added graceful handling for ClickZetta-specific error codes (CZLH-42000, "semantic analysis exception") - Methods now return empty results instead of crashing when tables don't exist - Added connection retry logic with exponential backoff 2. **Suppressed noisy ClickZetta client logs** - Temporarily set ClickZetta client logger to WARNING level during SET statement execution - Reduced our own log verbosity (info → debug) for routine operations - Applied to all locations where SET statements are executed ### **Files Changed**: - `api/core/rag/datasource/vdb/clickzetta/clickzetta_vector.py` - Enhanced error handling and reduced logging ## 🧪 Testing - ✅ Verified table existence checks handle missing tables gracefully - ✅ Confirmed connection retry logic works with network issues - ✅ Validated log noise reduction while maintaining essential debugging info - ✅ Tested all vector operations continue working normally ## 📊 Technical Details **Before**: Crashes on missing tables, excessive logging noise **After**: Graceful degradation, clean logs, improved reliability ### Key changes: - Enhanced `_table_exists()` to handle ClickZetta error patterns - Added connection retry with exponential backoff in `_init_connection()` - Suppressed ClickZetta client logging during config operations - Added table existence checks to all query methods ## 🎯 Impact - ✅ Eliminates ClickZetta crashes during dataset cleanup - ✅ Reduces log noise significantly - ✅ Improves overall ClickZetta stability - ✅ No breaking changes or performance impact --- **Ready for Review** 🚀
yindo added the pull-request label 2026-02-21 20:47:17 -05:00
yindo closed this issue 2026-02-21 20:47:17 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#30329