什么是“锁定"?通信缓冲区资源"吝啬的? [英] What does "lock | communication buffer resources" mean?

查看:121
本文介绍了什么是“锁定"?通信缓冲区资源"吝啬的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个报告死锁的错误日志:

I have an error log which reports a deadlock:

事务(进程ID 55)在锁|通信缓冲资源与另一个进程并已被选为死锁受害者.重新运行事务.

Transaction (Process ID 55) was deadlocked on lock | communication buffer resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

我正在尝试重现此错误,但是我的标准死锁SQL代码会产生不同错误:

I am trying to reproduce this error, but my standard deadlock SQL code produces a different error:

事务(进程ID 54)与另一个进程在锁资源上死锁,并且被选择为死锁受害者.重新运行事务.

Transaction (Process ID 54) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

我想非常清楚地说明,我不是在问什么僵局.我了解基本知识.

I want to be very clear that I am not asking what a deadlock is. I do understand the basics.

我的问题是: lock是什么意思?通信缓冲区资源在这种情况下?什么是通信缓冲区资源"? lock | 表示什么吗?

My question is: what is the meaning of lock | communication buffer resources in this context? What are "communication buffer resources"? Does the lock | signify anything?

我的最佳猜测是,当并行线程合并其结果时,将使用通信缓冲区.任何人都可以确认或否认吗?

My best guess is that a communication buffer is used when parallel threads combine their results. Can anyone confirm or deny this?

我的最终目标是以某种方式触发第一个错误再次发生.

My ultimate goal is to somehow trigger the first error to occur again.

推荐答案

我会将消息解释为在Lock资源或Communication Buffer资源的某种组合上的死锁.锁资源"是普通的对象锁,通信缓冲区资源"是用于合并并行查询结果的exchangeEvents.这些在 https://blogs.msdn.microsoft.com/bartd/2008/09/24/todays-annoyingly-unwieldy-term-intra-query-parallel-thread-deadlocks/其中相关段落是:

I would interpret the message as a deadlock on some combination of Lock resources or Communication Buffer resources. "Lock resources" are ordinary object locks, and "Communication Buffer resources" are exchangeEvents used for combining results of parallel queries. These are described further in https://blogs.msdn.microsoft.com/bartd/2008/09/24/todays-annoyingly-unwieldy-term-intra-query-parallel-thread-deadlocks/ where the relevant paragraph is:

"exchangeEvent"资源指示查询计划中是否存在并行运算符.想法是将诸如大型扫描,排序或联接之类的操作的工作进行拆分,以便可以在多个子线程上执行该工作.有生产者"线程可以完成繁重的工作,并将行集提供给消费者".查询内并行需要这些工作线程之间的信号传递:使用者可能必须等待生产者向他们提供更多数据,而生产者可能必须等待使用者完成对最后一批数据的处理.与并行相关的等待在SQL DMV中显示为CXPACKET或EXCHANGE等待类型(请注意,这些等待类型的存在是正常现象,仅表示并行查询执行的存在;就其本身而言,这些等待并不表明该类型或任何其他类型的死锁都在发生).

An "exchangeEvent" resource indicates the presence of parallelism operators in a query plan. The idea is that the work for an operation like a large scan, sort, or join is divided up so that it can be executed on multiple child threads. There are "producer" threads that do the grunt work and feed sets of rows to "consumers". Intra-query parallel requires signaling between these worker threads: the consumers may have to wait on producers to hand them more data, and the producers may have to wait for consumers to finish processing the last batch of data. Parallelism-related waits show up in SQL DMVs as CXPACKET or EXCHANGE wait types (note that the presence of these wait types is normal and simply indicates the presence of parallel query execution -- by themselves, these waits don't indicate that this type or any other type of deadlock is occurring).

我见过的其中一个的死锁图包括一组只有一个SPID的进程以及一个对象锁和exchangeEvents图.我猜想消息事务(进程ID 55)在另一个进程的锁|通信缓冲区资源上被死锁,并被选择为死锁的受害者.重新运行事务" 出现,而不是"Intra-query并行性导致服务器命令(进程ID#51)死锁.由于对象锁和exchangeevents的组合,请使用查询提示选项(maxdop 1)"重新运行查询,而无需查询内并行性.自撰写本文以来,该消息已在SQL Server中更改.

The deadlock graph for one of these I've seen included a set of processes with only one SPID and a graph of objectlocks and exchangeEvents. I guess the message "Transaction (Process ID 55) was deadlocked on lock | communication buffer resources with another process and has been chosen as the deadlock victim. Rerun the transaction" appears instead of "Intra-query parallelism caused your server command (process ID #51) to deadlock. Rerun the query without intra-query parallelism by using the query hint option (maxdop 1)" because of the combination of objectlocks and exchangeevents, or else the message has been changed in SQL Server since the article was written.

这篇关于什么是“锁定"?通信缓冲区资源"吝啬的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆