121
GB
What is the innodb_deadlock_detect system variable in MySQL and what is the alternative when it is disabled?
IN
MySQL में innodb_deadlock_detect सिस्टम वेरिएबल क्या है और इसके अक्षम होने पर विकल्प क्या है?
A
innodb_deadlock_detect=ON (default): InnoDB actively detects deadlocks using a wait-for graph and immediately resolves them by aborting a victim. innodb_deadlock_detect=OFF: deadlock detection is disabled; the lock wait timeout (innodb_lock_wait_timeout) becomes the only mechanism to break deadlocks - transactions wait until timeout then abort. Disabling detection reduces overhead in very high-concurrency scenarios but increases worst-case deadlock resolution time.
innodb_deadlock_detect=ON (डिफ़ॉल्ट): InnoDB सक्रिय रूप से प्रतीक्षा-ग्राफ़ का उपयोग करके गतिरोधों का पता लगाता है और पीड़ित को गर्भपात करके तुरंत उनका समाधान करता है। innodb_deadlock_detect=OFF: गतिरोध का पता लगाना अक्षम है; लॉक वेट टाइमआउट (innodb_lock_wait_timeout) गतिरोध को तोड़ने का एकमात्र तंत्र बन जाता है - लेनदेन टाइमआउट तक प्रतीक्षा करते हैं और फिर निरस्त हो जाते हैं। पहचान को अक्षम करने से बहुत उच्च-समवर्ती परिदृश्यों में ओवरहेड कम हो जाता है लेकिन सबसे खराब स्थिति में गतिरोध समाधान समय बढ़ जाता है।
B
It controls the deadlock timeout value
यह डेडलॉक टाइमआउट मान को नियंत्रित करता है
C
It controls whether deadlocks are logged to the error log
यह नियंत्रित करता है कि त्रुटि लॉग में गतिरोध लॉग हैं या नहीं
D
It determines which transaction becomes the deadlock victim
यह निर्धारित करता है कि कौन सा लेनदेन गतिरोध का शिकार बनेगा
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English)
innodb_deadlock_detect: ON = active detection (default, recommended for most workloads). OFF = use timeout-only for resolution. Use case for OFF: extremely high concurrency systems where the deadlock detection mutex itself becomes a bottleneck (the detection latch protects the wait-for graph - under extremely high concurrent locking, this latch becomes a serialization point). Alternative: use innodb_lock_wait_timeout with a short value (e.g., 5 seconds).
व्याख्या (हिन्दी)
innodb_deadlock_detect: ON = सक्रिय पहचान (डिफ़ॉल्ट, अधिकांश कार्यभार के लिए अनुशंसित)। बंद = समाधान के लिए केवल टाइमआउट का उपयोग करें। ऑफ के लिए केस का उपयोग करें: अत्यधिक उच्च समवर्ती प्रणाली जहां डेडलॉक डिटेक्शन म्यूटेक्स स्वयं एक बाधा बन जाता है (डिटेक्शन लैच प्रतीक्षा-ग्राफ की सुरक्षा करता है - अत्यधिक उच्च समवर्ती लॉकिंग के तहत, यह लैच एक क्रमबद्धता बिंदु बन जाता है)। वैकल्पिक: कम मान (जैसे, 5 सेकंड) के साथ innodb_lock_wait_timeout का उपयोग करें।