… | |
… | |
110 | -Cachesize => 8_000_000, |
110 | -Cachesize => 8_000_000, |
111 | -ErrFile => "$DB_HOME/errorlog.txt", |
111 | -ErrFile => "$DB_HOME/errorlog.txt", |
112 | # -ErrPrefix => "DATABASE", |
112 | # -ErrPrefix => "DATABASE", |
113 | -Verbose => 1, |
113 | -Verbose => 1, |
114 | -Flags => DB_CREATE | DB_RECOVER | DB_INIT_MPOOL | DB_INIT_LOCK | DB_INIT_TXN | $recover, |
114 | -Flags => DB_CREATE | DB_RECOVER | DB_INIT_MPOOL | DB_INIT_LOCK | DB_INIT_TXN | $recover, |
115 | -SetFlags => DB_AUTO_COMMIT | DB_LOG_AUTOREMOVE, |
115 | -SetFlags => DB_AUTO_COMMIT | DB_LOG_AUTOREMOVE | DB_TXN_WRITE_NOSYNC, |
116 | or die "unable to create/open database home $DB_HOME: $BerkeleyDB::Error"; |
116 | or die "unable to create/open database home $DB_HOME: $BerkeleyDB::Error"; |
117 | |
117 | |
118 | 1 |
118 | 1 |
119 | } |
119 | } |
120 | |
120 | |
… | |
… | |
128 | -Env => $DB_ENV, |
128 | -Env => $DB_ENV, |
129 | -Filename => $table, |
129 | -Filename => $table, |
130 | # -Filename => "database", |
130 | # -Filename => "database", |
131 | # -Subname => $table, |
131 | # -Subname => $table, |
132 | -Property => DB_CHKSUM, |
132 | -Property => DB_CHKSUM, |
133 | -Flags => DB_CREATE | DB_UPGRADE, |
133 | -Flags => DB_AUTO_COMMIT | DB_CREATE | DB_UPGRADE, |
134 | or die "unable to create/open database table $_[0]: $BerkeleyDB::Error" |
134 | or die "unable to create/open database table $_[0]: $BerkeleyDB::Error" |
135 | } |
135 | } |
136 | } |
136 | } |
137 | |
137 | |
138 | our %CB; |
138 | our %CB; |
… | |
… | |
141 | our ($fh_r_watcher, $fh_w_watcher); |
141 | our ($fh_r_watcher, $fh_w_watcher); |
142 | our $sync_timer; |
142 | our $sync_timer; |
143 | our $write_buf; |
143 | our $write_buf; |
144 | our $read_buf; |
144 | our $read_buf; |
145 | |
145 | |
146 | our $SYNC = Event->idle (min => 5, max => 60, parked => 1, cb => sub { |
146 | our $SYNC = Event->idle (min => 120, max => 180, parked => 1, cb => sub { |
147 | CFPlus::DB::Server::req (sync => sub { }); |
147 | CFPlus::DB::Server::req (sync => sub { }); |
148 | $_[0]->w->stop; |
148 | $_[0]->w->stop; |
149 | }); |
149 | }); |
150 | |
150 | |
151 | sub fh_write { |
151 | sub fh_write { |
… | |
… | |
269 | |
269 | |
270 | return $id; |
270 | return $id; |
271 | } |
271 | } |
272 | } |
272 | } |
273 | $txn->txn_abort; |
273 | $txn->txn_abort; |
|
|
274 | select undef, undef, undef, 0.01 * rand; |
274 | } |
275 | } |
275 | |
276 | |
276 | die "maximum number of transaction retries reached - database problems?"; |
277 | die "maximum number of transaction retries reached - database problems?"; |
277 | } |
278 | } |
278 | |
279 | |