Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit a898325

Browse files
Yingjun Wupoojanilangekar
authored andcommitted
add comments for statement-level write set
1 parent dcbd71d commit a898325

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/include/codegen/updater.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ class Updater {
7676
TargetList *target_list_;
7777

7878
// Write set for tracking newly created tuples inserted by the same statement
79+
// This statement-level write set is essential for avoiding the Halloween Problem,
80+
// which refers to the phenomenon that an update operation causes a change to
81+
// a tuple, potentially allowing this tuple to be visited more than once during
82+
// the same operation.
83+
// By maintaining the statement-level write set, an update operation will check
84+
// whether the to-be-updated tuple is created by the same operation.
7985
ReadWriteSet *statement_write_set_;
8086

8187
// Ownership information

src/include/executor/update_executor.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ class UpdateExecutor : public AbstractExecutor {
5454
const planner::ProjectInfo *project_info_ = nullptr;
5555

5656
// Write set for tracking newly created tuples inserted by the same statement
57+
// This statement-level write set is essential for avoiding the Halloween Problem,
58+
// which refers to the phenomenon that an update operation causes a change to
59+
// a tuple, potentially allowing this tuple to be visited more than once during
60+
// the same operation.
61+
// By maintaining the statement-level write set, an update operation will check
62+
// whether the to-be-updated tuple is created by the same operation.
5763
ReadWriteSet statement_write_set_;
5864
};
5965

0 commit comments

Comments
 (0)