الجمود الموزّع وقوافل الأقفال (Lock convoys)
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
recognize deadlocks and convoys within and across services.
الموضوعات المخطط لها
- Database deadlock: two transactions hold locks and wait for each other; the database aborts one. Fix with consistent lock ordering and shorter transactions.
- Distributed deadlock: A waits on B while B waits on A through synchronous calls and limited pools.
- Lock convoy: many requests queue on one hot row or lock, so throughput collapses to one at a time.
- Evidence: lock wait views, deadlock logs, thread dumps showing the lock owner; hot-row metrics.
تفاصيل المخطط المبدئي
عرض عملي
Two orders updating the same two stock rows in opposite order; fix by sorting item IDs before locking. For a hot row, consider sharding counters or optimistic updates.
اختبر فهمك
What is the standard fix for a lock-order deadlock?
أظهر الإجابة
Acquire locks in a consistent global order.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.