Skip to content
Snippets Groups Projects
Commit 6445380b authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

Merge branch 'too-long'

parents 02321509 8386438d
No related branches found
No related tags found
No related merge requests found
......@@ -86,7 +86,6 @@ static void
process_rw(struct port *port, u32 op, struct tbuf *data)
{
struct txn *txn = txn_begin();
ev_tstamp start = ev_now(), stop;
@try {
struct request *request = request_create(op, data);
......@@ -99,11 +98,6 @@ process_rw(struct port *port, u32 op, struct tbuf *data)
} @catch (id e) {
txn_rollback(txn);
@throw;
} @finally {
stop = ev_now();
if (stop - start > cfg.too_long_threshold)
say_warn("too long %s: %.3f sec",
request_name(op), stop - start);
}
}
......
......@@ -31,6 +31,7 @@
#include "space.h"
#include <recovery.h>
#include <fiber.h>
#include "request.h" /* for request_name */
void
txn_add_redo(struct txn *txn, u16 op, struct tbuf *data)
......@@ -77,11 +78,19 @@ txn_commit(struct txn *txn)
{
if (txn->old_tuple || txn->new_tuple) {
int64_t lsn = next_lsn(recovery_state);
ev_tstamp start = ev_now(), stop;
int res = wal_write(recovery_state, lsn, 0,
txn->op, &txn->req);
stop = ev_now();
say_warn("too long %s: %.3f sec",
request_name(txn->op), stop - start);
confirm_lsn(recovery_state, lsn, res == 0);
if (res)
tnt_raise(LoggedError, :ER_WAL_IO);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment