impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sailesh Mukil (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-4456: Change query exec state lock to a reader-writer lock
Date Sun, 13 Nov 2016 21:33:41 GMT
Sailesh Mukil has posted comments on this change.

Change subject: IMPALA-4456: Change query_exec_state_lock_ to a reader-writer lock
......................................................................


Patch Set 3:

> Once concern I have is about fairness. It's pretty critical that
 > writers don't get starved out of this lock because that prevents
 > queries from starting or finishing.
 > 
 > If there's enough demand for the reader-side of the lock such that
 > there's really no period at which the lock is free for writers, I
 > can see a starvation situation happening.
 > 
 > This doesn't happen right now because all once the lock is
 > released, there is always a period (however small) where the lock
 > is available for taking. You might need to think about an external
 > mechanism to prevent new readers from taking the lock when a writer
 > is waiting. That would make things more complicated, so let me know
 > if you have any better ideas.

Kudu has a RW lock that has a 'prefer writer' option.
https://github.com/apache/kudu/blob/0ce5ba594412de4365625485ea7b3c1ee21bf28d/src/kudu/util/rw_mutex.cc#L63

This will however starve readers once there are a steady stream of writers. But I don't think
that should be a big issue because we will have writers only while registering or unregistering
a query. So the no. writers on this lock is 2x no. of queries on that coordinator, which is
much less than the number of readers.

-- 
To view, visit http://gerrit.cloudera.org:8080/5021
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I790a95e7179f07aa7ba188d5422c5e054353ba0b
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Sailesh Mukil <sailesh@cloudera.com>
Gerrit-Reviewer: Henry Robinson <henry@cloudera.com>
Gerrit-Reviewer: Sailesh Mukil <sailesh@cloudera.com>
Gerrit-HasComments: No

Mime
View raw message