CUBRID Engine  latest
mvcc.c
Go to the documentation of this file.
1 /*
2  * Copyright 2008 Search Solution Corporation
3  * Copyright 2016 CUBRID Corporation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 /*
20  * mvcc.c - mvcc snapshot
21  */
22 
23 #ident "$Id$"
24 
25 #include "mvcc.h"
26 #include "dbtype.h"
27 #include "heap_file.h"
28 #include "page_buffer.h"
29 #include "overflow_file.h"
30 #include "perf_monitor.h"
31 #include "porting_inline.hpp"
32 #include "vacuum.h"
33 
34 #define MVCC_IS_REC_INSERTER_ACTIVE(thread_p, rec_header_p) \
35  (mvcc_is_active_id (thread_p, (rec_header_p)->mvcc_ins_id))
36 
37 #define MVCC_IS_REC_DELETER_ACTIVE(thread_p, rec_header_p) \
38  (mvcc_is_active_id (thread_p, (rec_header_p)->mvcc_del_id))
39 
40 #define MVCC_IS_REC_INSERTER_IN_SNAPSHOT(thread_p, rec_header_p, snapshot) \
41  (mvcc_is_id_in_snapshot (thread_p, (rec_header_p)->mvcc_ins_id, (snapshot)))
42 
43 #define MVCC_IS_REC_DELETER_IN_SNAPSHOT(thread_p, rec_header_p, snapshot) \
44  (mvcc_is_id_in_snapshot (thread_p, (rec_header_p)->mvcc_del_id, (snapshot)))
45 
46 #define MVCC_IS_REC_INSERTED_SINCE_MVCCID(rec_header_p, mvcc_id) \
47  (!MVCC_ID_PRECEDES ((rec_header_p)->mvcc_ins_id, (mvcc_id)))
48 
49 #define MVCC_IS_REC_DELETED_SINCE_MVCCID(rec_header_p, mvcc_id) \
50  (!MVCC_ID_PRECEDES ((rec_header_p)->mvcc_del_id, (mvcc_id)))
51 
52 
53 /* Used by mvcc_chain_satisfies_vacuum to avoid handling the same OID twice */
54 enum
55 {
56  /* Any positive value should be an index in relocated slots array */
60 };
61 
62 /* the lowest active mvcc id computed for last */
63 /* MVCCID recent_snapshot_lowest_active_mvccid = MVCCID_NULL; */
64 
65 static INLINE bool mvcc_is_id_in_snapshot (THREAD_ENTRY * thread_p, MVCCID mvcc_id, MVCC_SNAPSHOT * snapshot)
67 
68 static INLINE bool mvcc_is_active_id (THREAD_ENTRY * thread_p, MVCCID mvccid) __attribute__ ((ALWAYS_INLINE));
69 
70 /*
71  * mvcc_is_id_in_snapshot () - check whether mvcc id is in snapshot -
72  * is mvcc id active from snapshot point of view?
73  * return: true/false
74  * thread_p(in): thread entry
75  * mvcc_id(in): mvcc id
76  * snapshot(in): mvcc snapshot
77  */
78 STATIC_INLINE bool
79 mvcc_is_id_in_snapshot (THREAD_ENTRY * thread_p, MVCCID mvcc_id, MVCC_SNAPSHOT * snapshot)
80 {
81  assert (snapshot != NULL);
82 
83  if (MVCC_ID_PRECEDES (mvcc_id, snapshot->lowest_active_mvccid))
84  {
85  /* MVCC id is not active */
86  return false;
87  }
88 
89  if (MVCC_ID_FOLLOW_OR_EQUAL (mvcc_id, snapshot->highest_completed_mvccid))
90  {
91  /* MVCC id is active */
92  return true;
93  }
94 
95  return snapshot->m_active_mvccs.is_active (mvcc_id);
96 }
97 
98 /*
99  * mvcc_is_active_id - check whether given mvccid is active
100  *
101  * return: bool
102  *
103  * thread_p(in): thread entry
104  * id(in): MVCC id
105  *
106  * Note: Check whether an active transaction is active by searching transactions
107  * status into current history position. The data from current history position
108  * is atomically checked (See logtb_get_mvcc_snapshot_data comments).
109  */
110 STATIC_INLINE bool
112 {
114  MVCC_INFO *curr_mvcc_info = NULL;
115 
116  assert (tdes != NULL && mvccid != MVCCID_NULL);
117 
118  curr_mvcc_info = &tdes->mvccinfo;
119  if (MVCC_ID_PRECEDES (mvccid, curr_mvcc_info->recent_snapshot_lowest_active_mvccid))
120  {
121  return false;
122  }
123 
124  if (logtb_is_current_mvccid (thread_p, mvccid))
125  {
126  return true;
127  }
128 
129  return log_Gl.mvcc_table.is_active (mvccid);
130 }
131 
132 /*
133  * mvcc_satisfies_snapshot () - Check whether a record is valid for
134  * a snapshot
135  * return: - SNAPSHOT_SATISFIED: record is valid for snapshot
136  * - TOO_NEW_FOR_SNAPSHOT: record was either inserted or updated recently; commited after snapshot
137  * - TOO_OLD_FOR_SNAPSHOT: record not visible; deleted and commited
138  * thread_p(in): thread entry
139  * rec_header(out): the record header
140  * snapshot(in): the snapshot used for record validation
141  * page_ptr(in): the page where the record reside
142  */
145 {
146  assert (rec_header != NULL && snapshot != NULL);
147 
148  if (!MVCC_IS_HEADER_DELID_VALID (rec_header))
149  {
150  /* The record is not deleted */
151  if (!MVCC_IS_FLAG_SET (rec_header, OR_MVCC_FLAG_VALID_INSID))
152  {
153  /* Record was inserted and is visible for all transactions */
155  {
158  }
159 
160  return SNAPSHOT_SATISFIED;
161  }
162  else if (MVCC_IS_REC_INSERTED_BY_ME (thread_p, rec_header))
163  {
164  /* Record was inserted by current transaction and is visible */
166  {
167  perfmon_mvcc_snapshot (thread_p, PERF_SNAPSHOT_SATISFIES_SNAPSHOT,
169  }
170  return SNAPSHOT_SATISFIED;
171  }
172  else if (MVCC_IS_REC_INSERTER_IN_SNAPSHOT (thread_p, rec_header, snapshot))
173  {
174  /* Record was inserted by an active transaction or by a transaction that has committed after snapshot was
175  * obtained. */
177  {
178  perfmon_mvcc_snapshot (thread_p, PERF_SNAPSHOT_SATISFIES_SNAPSHOT,
180  }
181  return TOO_NEW_FOR_SNAPSHOT;
182  }
183  else
184  {
185  /* The inserter transaction has committed and the record is visible to current transaction. */
187  {
188  if (rec_header->mvcc_ins_id != MVCCID_ALL_VISIBLE && vacuum_is_mvccid_vacuumed (rec_header->mvcc_ins_id))
189  {
190  perfmon_mvcc_snapshot (thread_p, PERF_SNAPSHOT_SATISFIES_SNAPSHOT,
192  }
193  else
194  {
195  perfmon_mvcc_snapshot (thread_p, PERF_SNAPSHOT_SATISFIES_SNAPSHOT,
197  }
198  }
199  return SNAPSHOT_SATISFIED;
200  }
201  }
202  else
203  {
204  /* The record is deleted */
205  if (MVCC_IS_REC_DELETED_BY_ME (thread_p, rec_header))
206  {
207  /* The record was deleted by current transaction and it is not visible anymore. */
209  {
212  }
213  return TOO_OLD_FOR_SNAPSHOT;
214  }
215  else if (MVCC_IS_REC_INSERTER_IN_SNAPSHOT (thread_p, rec_header, snapshot))
216  {
217  /* !!TODO: Is this check necessary? It seems that if inserter is active, then so will be the deleter (actually
218  * they will be the same). It only adds an extra-check in a function frequently called.
219  */
221  {
224  }
225  return TOO_NEW_FOR_SNAPSHOT;
226  }
227  else if (MVCC_IS_REC_DELETER_IN_SNAPSHOT (thread_p, rec_header, snapshot))
228  {
229  /* The record was deleted by an active transaction or by a transaction that has committed after snapshot was
230  * obtained. */
232  {
233  perfmon_mvcc_snapshot (thread_p, PERF_SNAPSHOT_SATISFIES_SNAPSHOT,
235  }
236  return SNAPSHOT_SATISFIED;
237  }
238  else
239  {
240  /* The deleter transaction has committed and the record is not visible to current transaction. */
242  {
243  if (vacuum_is_mvccid_vacuumed (rec_header->mvcc_del_id))
244  {
245  perfmon_mvcc_snapshot (thread_p, PERF_SNAPSHOT_SATISFIES_SNAPSHOT,
247  }
248  else
249  {
250  perfmon_mvcc_snapshot (thread_p, PERF_SNAPSHOT_SATISFIES_SNAPSHOT,
252  }
253  }
254  return TOO_OLD_FOR_SNAPSHOT;
255  }
256  }
257 }
258 
259 /*
260  * mvcc_is_not_deleted_for_snapshot () - Check whether a record is deleted or not regarding the snapshot
261  * return : TOO_OLD_FOR_SNAPSHOT if record is deleted and deleter is either me or is not active.
262  * SNAPSHOT_SATISFIED if record is not deleted or deleter is neither me nor is still active.
263  * thread_p (in) : thread entry
264  * rec_header (in) : the record header
265  * snapshot (in) : the snapshot used for record validation
266  */
269 {
270  assert (rec_header != NULL && snapshot != NULL);
271 
272  if (!MVCC_IS_HEADER_DELID_VALID (rec_header))
273  {
274  /* The record is not deleted */
275  return SNAPSHOT_SATISFIED;
276  }
277  else
278  {
279  /* The record is deleted */
280  if (MVCC_IS_REC_DELETED_BY_ME (thread_p, rec_header))
281  {
282  /* The record was deleted by current transaction and it is not visible anymore. */
283  return TOO_OLD_FOR_SNAPSHOT;
284  }
285  else if (MVCC_IS_REC_DELETER_IN_SNAPSHOT (thread_p, rec_header, snapshot))
286  {
287  /* The record was deleted by an active transaction or by a transaction that has committed after snapshot was
288  * obtained. */
289  return SNAPSHOT_SATISFIED;
290  }
291  else
292  {
293  /* The deleter transaction has committed and the record is not visible to current transaction. */
294  return TOO_OLD_FOR_SNAPSHOT;
295  }
296  }
297 }
298 
299 /*
300  * mvcc_satisfies_vacuum () - Check whether record satisfies VACUUM
301  *
302  * return : Heap record satisfies vacuum result.
303  * thread_p (in) : Thread entry.
304  * rec_header (in) : MVCC record header.
305  * oldest_mvccid (in) : MVCCID for oldest active transaction.
306  * page_p (in) : Heap page pointer.
307  */
309 mvcc_satisfies_vacuum (THREAD_ENTRY * thread_p, MVCC_REC_HEADER * rec_header, MVCCID oldest_mvccid)
310 {
311  if (!MVCC_IS_HEADER_DELID_VALID (rec_header) || MVCC_IS_REC_DELETED_SINCE_MVCCID (rec_header, oldest_mvccid))
312  {
313  /* The record was not deleted or was recently deleted and cannot be vacuumed completely. */
314  if (!MVCC_IS_HEADER_INSID_NOT_ALL_VISIBLE (rec_header)
315  || MVCC_IS_REC_INSERTED_SINCE_MVCCID (rec_header, oldest_mvccid))
316  {
317  /* 1: Record is all visible, and insert MVCCID was already removed/replaced. 2: Record was recently inserted
318  * and is not yet visible to all active transactions. Cannot vacuum insert MVCCID. */
320  {
321  if (MVCC_IS_HEADER_DELID_VALID (rec_header)
322  && MVCC_IS_REC_DELETED_SINCE_MVCCID (rec_header, oldest_mvccid))
323  {
324  perfmon_mvcc_snapshot (thread_p, PERF_SNAPSHOT_SATISFIES_VACUUM,
326  }
327  else if (!MVCC_IS_HEADER_INSID_NOT_ALL_VISIBLE (rec_header))
328  {
329  perfmon_mvcc_snapshot (thread_p, PERF_SNAPSHOT_SATISFIES_VACUUM,
331  }
332  else
333  {
334  perfmon_mvcc_snapshot (thread_p, PERF_SNAPSHOT_SATISFIES_VACUUM,
336  }
337  }
339  }
340  else
341  {
342  /* The inserter transaction has committed and the record is visible to all running transactions. Insert
343  * MVCCID and previous version lsa can be removed. */
345  {
348  }
350  }
351  }
352  else
353  {
354  /* The deleter transaction has committed and the record is not visible to any running transactions. */
356  {
359  }
360  return VACUUM_RECORD_REMOVE;
361  }
362 }
363 
364 /*
365  * mvcc_satisfies_delete () - Check whether a record is valid for
366  * instant snapshot
367  * return: true, if the record is valid for snapshot
368  * thread_p(in): thread entry
369  * rec_header(out): the record header
370  * snapshot(in): the snapshot used for record validation
371  * page_ptr(in): the page where the record reside
372  *
373  * Note: The function return a complex result since delete/update commands
374  * needs to know not only if the row is visible or not
375  */
378 {
379  assert (rec_header != NULL);
380 
381  if (!MVCC_IS_HEADER_DELID_VALID (rec_header))
382  {
383  /* Record was not deleted */
384  if (!MVCC_IS_FLAG_SET (rec_header, OR_MVCC_FLAG_VALID_INSID))
385  {
386  /* Record was inserted and is visible for all transactions */
388  {
391  }
393  }
394 
395  if (MVCC_IS_REC_INSERTED_BY_ME (thread_p, rec_header))
396  {
397  /* Record is only visible to current transaction and can be safely deleted. */
399  {
402  }
404  }
405  else if (MVCC_IS_REC_INSERTER_ACTIVE (thread_p, rec_header))
406  {
407  /* Record is inserted by an active transaction and is not visible to current transaction. */
409  {
412  }
414  }
415  else
416  {
417  /* The inserter transaction has committed and the record can be deleted by current transaction. */
419  {
420  if (rec_header->mvcc_ins_id != MVCCID_ALL_VISIBLE && vacuum_is_mvccid_vacuumed (rec_header->mvcc_ins_id))
421  {
422  perfmon_mvcc_snapshot (thread_p, PERF_SNAPSHOT_SATISFIES_DELETE,
424  }
425  else
426  {
427  perfmon_mvcc_snapshot (thread_p, PERF_SNAPSHOT_SATISFIES_DELETE,
429  }
430  }
432  }
433  }
434  else
435  {
436  /* Record was already deleted */
437  if (MVCC_IS_REC_DELETED_BY_ME (thread_p, rec_header))
438  {
439  /* Record was already deleted by me... */
441  {
444  }
446  }
447  else if (MVCC_IS_REC_DELETER_ACTIVE (thread_p, rec_header))
448  {
449  /* Record was deleted by an active transaction. Current transaction must wait until the deleter completes. */
451  {
454  }
456  }
457  else
458  {
459  /* Record was already deleted and the deleter has committed. Cannot be updated by current transaction. */
461  {
462  if (vacuum_is_mvccid_vacuumed (rec_header->mvcc_del_id))
463  {
464  perfmon_mvcc_snapshot (thread_p, PERF_SNAPSHOT_SATISFIES_DELETE,
466  }
467  else
468  {
469  perfmon_mvcc_snapshot (thread_p, PERF_SNAPSHOT_SATISFIES_DELETE,
471  }
472  }
473  return DELETE_RECORD_DELETED;
474  }
475  }
476 }
477 
478 /*
479  * mvcc_satisfies_dirty () - Check whether a record is visible considering following effects:
480  * - committed transactions
481  * - in progress transactions
482  * - previous commands of current transaction
483  *
484  * return : TOO_OLD_FOR_SNAPSHOT, if the record is deleted and deleter is either me or is not active.
485  * SNAPSHOT_SATISFIED, if the record is not deleted and deleter is neither me nor is not active.
486  * thread_p (in) : thread entry
487  * rec_header (in) : the record header
488  * snapshot (in) : the snapshot used for record validation
489  *
490  * NOTE: Besides returning snapshot result, when the result is SNAPSHOT_SATISFIED, the function have also have side
491  * effects, changing snapshot->lowest_active_mvccid and snapshot->highest_completed_mvccid.
492  * If record is recently inserted and inserter is considered active, its MVCCID is saved in
493  * snapshot->lowest_active_mvccid.
494  * If record is recently deleted and deleter is considered active, its MVCCID is saved in
495  * snapshot->highest_completed_mvccid.
496  * Otherwise, the two values are set to MVCCID_NULL.
497  *
498  * NOTE: The snapshot argument can never be the transaction snapshot!
499  */
501 mvcc_satisfies_dirty (THREAD_ENTRY * thread_p, MVCC_REC_HEADER * rec_header, MVCC_SNAPSHOT * snapshot)
502 {
503  assert (rec_header != NULL && snapshot != NULL);
504 
505  snapshot->lowest_active_mvccid = MVCCID_NULL;
507 
508  if (!MVCC_IS_HEADER_DELID_VALID (rec_header))
509  {
510  /* Record was not deleted */
511  if (!MVCC_IS_FLAG_SET (rec_header, OR_MVCC_FLAG_VALID_INSID))
512  {
513  /* Record was inserted and is visible for all transactions */
515  {
518  }
519  return SNAPSHOT_SATISFIED;
520  }
521  else if (MVCC_IS_REC_INSERTED_BY_ME (thread_p, rec_header))
522  {
523  /* Record was inserted by current transaction and is visible */
525  {
528  }
529  return SNAPSHOT_SATISFIED;
530  }
531  else if (MVCC_IS_REC_INSERTER_ACTIVE (thread_p, rec_header))
532  {
533  /* Record is inserted by an active transaction and is visible */
534  snapshot->lowest_active_mvccid = MVCC_GET_INSID (rec_header);
536  {
539  }
540  return SNAPSHOT_SATISFIED;
541  }
542  else
543  {
544  /* Record is inserted by committed transaction. */
546  {
547  if (rec_header->mvcc_ins_id != MVCCID_ALL_VISIBLE && vacuum_is_mvccid_vacuumed (rec_header->mvcc_ins_id))
548  {
549  perfmon_mvcc_snapshot (thread_p, PERF_SNAPSHOT_SATISFIES_DIRTY,
551  }
552  else
553  {
554  perfmon_mvcc_snapshot (thread_p, PERF_SNAPSHOT_SATISFIES_DIRTY,
556  }
557  }
558  return SNAPSHOT_SATISFIED;
559  }
560  }
561  else
562  {
563  /* Record was already deleted */
564  if (MVCC_IS_REC_DELETED_BY_ME (thread_p, rec_header))
565  {
566  /* Record was deleted by current transaction and is not visible */
568  {
571  }
572  return TOO_OLD_FOR_SNAPSHOT;
573  }
574  else if (MVCC_IS_REC_DELETER_ACTIVE (thread_p, rec_header))
575  {
576  /* Record was deleted by other active transaction and is still visible */
577  snapshot->highest_completed_mvccid = rec_header->mvcc_del_id;
579  {
582  }
583 
584  return SNAPSHOT_SATISFIED;
585  }
586  else
587  {
588  /* Record was already deleted and the deleter has committed. */
590  {
591  if (vacuum_is_mvccid_vacuumed (rec_header->mvcc_del_id))
592  {
593  perfmon_mvcc_snapshot (thread_p, PERF_SNAPSHOT_SATISFIES_DIRTY,
595  }
596  else
597  {
598  perfmon_mvcc_snapshot (thread_p, PERF_SNAPSHOT_SATISFIES_DIRTY,
600  }
601  }
602  return TOO_OLD_FOR_SNAPSHOT;
603  }
604  }
605 }
606 
607 /*
608 * mvcc_is_mvcc_disabled_class () - MVCC is disabled for root class and
609 * db_serial, db_partition.
610 *
611 * return : True if MVCC is disabled for class.
612 * thread_p (in) : Thread entry.
613 * class_oid (in) : Class OID.
614 */
615 bool
616 mvcc_is_mvcc_disabled_class (const OID * class_oid)
617 {
618  if (OID_ISNULL (class_oid) || OID_IS_ROOTOID (class_oid))
619  {
620  /* MVCC is disabled for root class */
621  return true;
622  }
623 
624  if (oid_is_serial (class_oid))
625  {
626  return true;
627  }
628 
630  {
631  return true;
632  }
633 
635  {
636  return true;
637  }
638 
639  return false;
640 }
641 
642 // *INDENT-OFF*
644  : lowest_active_mvccid (MVCCID_NULL)
645  , highest_completed_mvccid (MVCCID_NULL)
646  , m_active_mvccs ()
647  , snapshot_fnc (NULL)
648  , valid (false)
649 {
650 }
651 
652 void
654 {
655  snapshot_fnc = NULL;
658 
660 
661  valid = false;
662 }
663 
664 void
666 {
667  dest.m_active_mvccs.initialize ();
669 
672  dest.snapshot_fnc = snapshot_fnc;
673  dest.valid = valid;
674 }
675 
677  : snapshot ()
678  , id (MVCCID_NULL)
679  , recent_snapshot_lowest_active_mvccid (MVCCID_NULL)
680  , sub_ids ()
681 {
682 }
683 
684 void
686 {
687  new (this) mvcc_info ();
688 }
689 
690 void
692 {
693  snapshot.reset ();
694  id = MVCCID_NULL;
696  sub_ids.clear ();
697 }
698 // *INDENT-ON*
MVCCID recent_snapshot_lowest_active_mvccid
Definition: mvcc.h:202
enum mvcc_satisfies_delete_result MVCC_SATISFIES_DELETE_RESULT
Definition: mvcc.h:224
MVCCID highest_completed_mvccid
Definition: mvcc.h:172
MVCC_SATISFIES_DELETE_RESULT mvcc_satisfies_delete(THREAD_ENTRY *thread_p, MVCC_REC_HEADER *rec_header)
Definition: mvcc.c:377
#define __attribute__(X)
Definition: porting.h:36
#define MVCC_IS_HEADER_DELID_VALID(rec_header_p)
Definition: mvcc.h:87
bool logtb_is_current_mvccid(THREAD_ENTRY *thread_p, MVCCID mvccid)
#define MVCC_GET_INSID(header)
Definition: mvcc.h:51
static INLINE bool mvcc_is_active_id(THREAD_ENTRY *thread_p, MVCCID mvccid) __attribute__((ALWAYS_INLINE))
Definition: mvcc.c:111
mvcc_info()
Definition: mvcc.c:676
#define MVCC_IS_REC_INSERTER_IN_SNAPSHOT(thread_p, rec_header_p, snapshot)
Definition: mvcc.c:40
MVCCID mvcc_ins_id
Definition: mvcc.h:43
MVCC_SATISFIES_SNAPSHOT_RESULT mvcc_satisfies_snapshot(THREAD_ENTRY *thread_p, MVCC_REC_HEADER *rec_header, MVCC_SNAPSHOT *snapshot)
Definition: mvcc.c:144
bool mvcc_is_mvcc_disabled_class(const OID *class_oid)
Definition: mvcc.c:616
LOG_GLOBAL log_Gl
#define ALWAYS_INLINE
#define MVCC_IS_HEADER_INSID_NOT_ALL_VISIBLE(rec_header_p)
Definition: mvcc.h:91
#define MVCC_ID_FOLLOW_OR_EQUAL(id1, id2)
Definition: mvcc.h:138
#define OR_MVCC_FLAG_VALID_INSID
#define MVCCID_NULL
bool oid_is_serial(const OID *oid)
Definition: oid.c:159
LOG_TDES * LOG_FIND_TDES(int tran_index)
Definition: log_impl.h:1095
bool valid
Definition: mvcc.h:178
MVCC_SATISFIES_SNAPSHOT_RESULT mvcc_satisfies_dirty(THREAD_ENTRY *thread_p, MVCC_REC_HEADER *rec_header, MVCC_SNAPSHOT *snapshot)
Definition: mvcc.c:501
MVCCID lowest_active_mvccid
Definition: mvcc.h:171
void THREAD_ENTRY
static INLINE bool mvcc_is_id_in_snapshot(THREAD_ENTRY *thread_p, MVCCID mvcc_id, MVCC_SNAPSHOT *snapshot) __attribute__((ALWAYS_INLINE))
Definition: mvcc.c:79
mvcctable mvcc_table
Definition: log_impl.h:684
#define MVCCID_ALL_VISIBLE
mvcc_snapshot()
Definition: mvcc.c:643
void copy_to(mvcc_snapshot &other) const
Definition: mvcc.c:665
enum mvcc_satisfies_vacuum_result MVCC_SATISFIES_VACUUM_RESULT
Definition: mvcc.h:233
#define MVCC_IS_REC_DELETER_ACTIVE(thread_p, rec_header_p)
Definition: mvcc.c:37
#define assert(x)
#define STATIC_INLINE
#define OID_IS_ROOTOID(oidp)
Definition: oid.h:82
bool is_active(MVCCID mvccid) const
Definition: mvcc_table.cpp:424
void reset()
Definition: mvcc.c:691
MVCC_INFO mvccinfo
Definition: log_impl.h:463
mvcc_active_tran m_active_mvccs
Definition: mvcc.h:174
MVCC_SATISFIES_SNAPSHOT_RESULT mvcc_is_not_deleted_for_snapshot(THREAD_ENTRY *thread_p, MVCC_REC_HEADER *rec_header, MVCC_SNAPSHOT *snapshot)
Definition: mvcc.c:268
#define NULL
Definition: freelistheap.h:34
UINT64 MVCCID
#define MVCC_IS_FLAG_SET(rec_header_p, flags)
Definition: mvcc.h:84
STATIC_INLINE bool perfmon_is_perf_tracking_and_active(int activation_flag) __attribute__((ALWAYS_INLINE))
#define MVCC_IS_REC_INSERTED_BY_ME(thread_p, rec_header_p)
Definition: mvcc.h:114
#define MVCC_ID_PRECEDES(id1, id2)
Definition: mvcc.h:137
#define MVCC_IS_REC_INSERTER_ACTIVE(thread_p, rec_header_p)
Definition: mvcc.c:34
void init()
Definition: mvcc.c:685
#define MVCC_IS_REC_DELETED_BY_ME(thread_p, rec_header_p)
Definition: mvcc.h:118
#define LOG_FIND_THREAD_TRAN_INDEX(thrd)
Definition: perf_monitor.h:158
#define MVCC_IS_REC_INSERTED_SINCE_MVCCID(rec_header_p, mvcc_id)
Definition: mvcc.c:46
#define MVCC_IS_REC_DELETER_IN_SNAPSHOT(thread_p, rec_header_p, snapshot)
Definition: mvcc.c:43
#define MVCC_IS_REC_DELETED_SINCE_MVCCID(rec_header_p, mvcc_id)
Definition: mvcc.c:49
bool vacuum_is_mvccid_vacuumed(MVCCID id)
Definition: vacuum.c:7361
MVCC_SNAPSHOT snapshot
Definition: mvcc.h:194
bool is_active(MVCCID mvccid) const
bool oid_check_cached_class_oid(const int cache_id, const OID *oid)
Definition: oid.c:327
#define INLINE
void copy_to(mvcc_active_tran &dest, copy_safety safety) const
MVCC_SNAPSHOT_FUNC snapshot_fnc
Definition: mvcc.h:176
#define OID_ISNULL(oidp)
Definition: oid.h:81
enum mvcc_satisfies_snapshot_result MVCC_SATISFIES_SNAPSHOT_RESULT
Definition: mvcc.h:164
std::vector< MVCCID > sub_ids
Definition: mvcc.h:205
MVCC_SATISFIES_VACUUM_RESULT mvcc_satisfies_vacuum(THREAD_ENTRY *thread_p, MVCC_REC_HEADER *rec_header, MVCCID oldest_mvccid)
Definition: mvcc.c:309
MVCCID mvcc_del_id
Definition: mvcc.h:44
void reset()
Definition: mvcc.c:653