Alexey Serbin has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/16928 )

Change subject: [transactions] remove cached TransactionEntry's state
......................................................................

[transactions] remove cached TransactionEntry's state

With changelist fa21bf618, an atomic field was added to TransactionEntry
to contain a cached state for an entry.  The motivation was to provide
lock-free access the state of the entry: accessing the metadata stored
as a COW object in the 'metadata_' field involves taking read lock
for that. The transaction keepalive tracking task needs to check the
status of an entry every time it runs (10 seconds by default), and
there may be many txn records records.

However, that approach didn't provide an automatic update of the cached
field upon modification of the underlying 'metadata_' object, and
updating that manually proved to be cumbersome and bug prone.  A few
alternatives to update the cached field automatically were considered,
but after realizing that we don't have hard data showing a lot of
lock contention or resources spent on lock acquisition, the former
approach was deemed to be a premature optimization.

With this changelist, the cached field is removed and the
TransactionEntry::state() accessor now takes a read lock
to access the state of the transactional entry.

Change-Id: Iab1ffe4312d21b732d7f37f7b54f28e43c979e35
Reviewed-on: http://gerrit.cloudera.org:8080/16928
Reviewed-by: Andrew Wong <aw...@cloudera.com>
Tested-by: Kudu Jenkins
---
M src/kudu/transactions/txn_status_entry.cc
M src/kudu/transactions/txn_status_entry.h
M src/kudu/transactions/txn_status_manager.cc
3 files changed, 9 insertions(+), 22 deletions(-)

Approvals:
  Andrew Wong: Looks good to me, approved
  Kudu Jenkins: Verified

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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Iab1ffe4312d21b732d7f37f7b54f28e43c979e35
Gerrit-Change-Number: 16928
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <aser...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <aser...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Hao Hao <hao....@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)

Reply via email to