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 @@ -191,24 +191,25 @@ static xid_t max(xid_t a, xid_t b) {
191
191
192
192
static void gen_snapshot (Snapshot * s ) {
193
193
Transaction * t ;
194
+ int n = 0 ;
194
195
s -> times_sent = 0 ;
195
- s -> nactive = 0 ;
196
- s -> xmin = MAX_XID ;
197
- s -> xmax = MIN_XID ;
198
- for (t = (Transaction * )active_transactions .next ; t != (Transaction * )& active_transactions ; t = (Transaction * )t -> elem .next ) {
196
+ for (t = (Transaction * )active_transactions .prev ; t != (Transaction * )& active_transactions ; t = (Transaction * )t -> elem .prev ) {
197
+ /*
199
198
if (t->xid < s->xmin) {
200
199
s->xmin = t->xid;
201
200
}
202
201
if (t->xid >= s->xmax) {
203
202
s->xmax = t->xid + 1;
204
203
}
205
- s -> active [s -> nactive ++ ] = t -> xid ;
204
+ */
205
+ s -> active [n ++ ] = t -> xid ;
206
206
}
207
- if (s -> nactive > 0 ) {
208
- assert (s -> xmin < MAX_XID );
209
- assert (s -> xmax > MIN_XID );
207
+ s -> nactive = n ;
208
+ if (n > 0 ) {
209
+ s -> xmin = s -> active [0 ];
210
+ s -> xmax = s -> active [n - 1 ];
210
211
assert (s -> xmin <= s -> xmax );
211
- snapshot_sort (s );
212
+ // snapshot_sort(s);
212
213
} else {
213
214
s -> xmin = s -> xmax = 0 ;
214
215
}
You can’t perform that action at this time.
0 commit comments