-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
-
Storage Engines
/* * Acquire a snapshot if coming through the eviction thread route. Also, if we have entered * eviction through application threads and we have a transaction snapshot, we will use our * existing snapshot to evict pages that are not globally visible based on the last_running * transaction. Avoid using snapshots when application transactions are in the final stages of * commit or rollback as they have already released the snapshot. Otherwise, it becomes harder * in the later part of the code to detect updates that belonged to the last running application * transaction. */ use_snapshot_for_app_thread = !F_ISSET(session, WT_SESSION_INTERNAL) && !WT_IS_METADATA(session->dhandle) && WT_SESSION_TXN_SHARED(session)->id != WT_TXN_NONE && F_ISSET(session->txn, WT_TXN_HAS_SNAPSHOT);
I come across this code that decide whether we can use application thread's snapshot to do eviction.
I don't see a reason why we cannot use application thread's snapshot if itself doesn't have a transaction id yet.
For read only transactions, we should still be able to evict base on its snapshot.