File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -193,24 +193,25 @@ static xid_t max(xid_t a, xid_t b) {
193
193
194
194
static void gen_snapshot (Snapshot * s ) {
195
195
Transaction * t ;
196
+ int n = 0 ;
196
197
s -> times_sent = 0 ;
197
- s -> nactive = 0 ;
198
- s -> xmin = MAX_XID ;
199
- s -> xmax = MIN_XID ;
200
- for (t = (Transaction * )active_transactions .next ; t != (Transaction * )& active_transactions ; t = (Transaction * )t -> elem .next ) {
198
+ for (t = (Transaction * )active_transactions .prev ; t != (Transaction * )& active_transactions ; t = (Transaction * )t -> elem .prev ) {
199
+ /*
201
200
if (t->xid < s->xmin) {
202
201
s->xmin = t->xid;
203
202
}
204
203
if (t->xid >= s->xmax) {
205
204
s->xmax = t->xid + 1;
206
205
}
207
- s -> active [s -> nactive ++ ] = t -> xid ;
206
+ */
207
+ s -> active [n ++ ] = t -> xid ;
208
208
}
209
- if (s -> nactive > 0 ) {
210
- assert (s -> xmin < MAX_XID );
211
- assert (s -> xmax > MIN_XID );
209
+ s -> nactive = n ;
210
+ if (n > 0 ) {
211
+ s -> xmin = s -> active [0 ];
212
+ s -> xmax = s -> active [n - 1 ];
212
213
assert (s -> xmin <= s -> xmax );
213
- snapshot_sort (s );
214
+ // snapshot_sort(s);
214
215
} else {
215
216
s -> xmin = s -> xmax = 0 ;
216
217
}
You can’t perform that action at this time.
0 commit comments