From bd9163904a88dd54d5ef56651d1b2413dfb9b3f5 Mon Sep 17 00:00:00 2001 From: He Wang Date: Fri, 16 Jan 2026 20:46:37 +0800 Subject: [PATCH] fix(ob_conn): ignore duplicate errors when executing 'create_idx' (#12661) ### What problem does this PR solve? Skip duplicate errors to avoid 'create_idx' failures caused by slow metadata refresh or external modifications. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- rag/utils/ob_conn.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rag/utils/ob_conn.py b/rag/utils/ob_conn.py index 6f6457cda..78a77e9c9 100644 --- a/rag/utils/ob_conn.py +++ b/rag/utils/ob_conn.py @@ -329,6 +329,14 @@ def _try_with_lock(lock_name: str, process_func, check_func, timeout: int = None try: process_func() return + except Exception as e: + if "Duplicate" in str(e): + # In some cases, the schema may change after the lock is acquired, so if the error message + # indicates that the column or index is duplicated, it should be assumed that 'process_func' + # has been executed correctly. + logger.warning(f"Skip processing {lock_name} due to duplication: {str(e)}") + return + raise finally: lock.release()