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) {
193193
194194static void gen_snapshot (Snapshot * s ) {
195195 Transaction * t ;
196+ int n = 0 ;
196197 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+ /*
201200 if (t->xid < s->xmin) {
202201 s->xmin = t->xid;
203202 }
204203 if (t->xid >= s->xmax) {
205204 s->xmax = t->xid + 1;
206205 }
207- s -> active [s -> nactive ++ ] = t -> xid ;
206+ */
207+ s -> active [n ++ ] = t -> xid ;
208208 }
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 ];
212213 assert (s -> xmin <= s -> xmax );
213- snapshot_sort (s );
214+ // snapshot_sort(s);
214215 } else {
215216 s -> xmin = s -> xmax = 0 ;
216217 }
You can’t perform that action at this time.
0 commit comments