@@ -1398,16 +1398,35 @@ Result RestReplicationHandler::processRestoreDataBatch(
1398
1398
options.ignoreRevs = true ;
1399
1399
options.isRestore = true ;
1400
1400
options.waitForSync = false ;
1401
+ double startTime = TRI_microtime ();
1401
1402
OperationResult opRes =
1402
1403
trx.remove (collectionName, oldBuilder.slice (), options);
1404
+ double duration = TRI_microtime () - startTime;
1403
1405
if (opRes.fail ()) {
1406
+ LOG_TOPIC (WARN, Logger::CLUSTER)
1407
+ << " Could not delete " << oldBuilder.slice ().length ()
1408
+ << " documents for restore: "
1409
+ << opRes.result .errorMessage ();
1404
1410
return opRes.result ;
1405
1411
}
1412
+ if (duration > 30 ) {
1413
+ LOG_TOPIC (INFO, Logger::PERFORMANCE) << << " Restored/deleted "
1414
+ << oldBuilder.slice ().length () << " documents in time: " << duration
1415
+ << " seconds." ;
1416
+ }
1406
1417
} catch (arangodb::basics::Exception const & ex) {
1418
+ LOG_TOPIC (WARN, Logger::CLUSTER)
1419
+ << " Could not delete documents for restore exception (1): "
1420
+ << ex.what ();
1407
1421
return Result (ex.code (), ex.what ());
1408
1422
} catch (std::exception const & ex) {
1423
+ LOG_TOPIC (WARN, Logger::CLUSTER)
1424
+ << " Could not delete documents for restore exception (2): "
1425
+ << ex.what ();
1409
1426
return Result (TRI_ERROR_INTERNAL, ex.what ());
1410
1427
} catch (...) {
1428
+ LOG_TOPIC (WARN, Logger::CLUSTER)
1429
+ << " Could not delete documents for restore exception (3)." ;
1411
1430
return Result (TRI_ERROR_INTERNAL);
1412
1431
}
1413
1432
@@ -1478,15 +1497,34 @@ Result RestReplicationHandler::processRestoreDataBatch(
1478
1497
options.ignoreRevs = true ;
1479
1498
options.isRestore = true ;
1480
1499
options.waitForSync = false ;
1500
+ double startTime = TRI_microtime ();
1481
1501
opRes = trx.insert (collectionName, requestSlice, options);
1502
+ double duration = TRI_microtime () - startTime;
1482
1503
if (opRes.fail ()) {
1504
+ LOG_TOPIC (WARN, Logger::CLUSTER)
1505
+ << " Could not insert " << requestSlice.length ()
1506
+ << " documents for restore: "
1507
+ << opRes.result .errorMessage ();
1483
1508
return opRes.result ;
1484
1509
}
1510
+ if (duration > 30 ) {
1511
+ LOG_TOPIC (INFO, Logger::PERFORMANCE) << << " Restored/inserted "
1512
+ << requestSlice.length () << " documents in time: " << duration
1513
+ << " seconds." ;
1514
+ }
1485
1515
} catch (arangodb::basics::Exception const & ex) {
1516
+ LOG_TOPIC (WARN, Logger::CLUSTER)
1517
+ << " Could not insert documents for restore exception (1): "
1518
+ << ex.what ();
1486
1519
return Result (ex.code (), ex.what ());
1487
1520
} catch (std::exception const & ex) {
1521
+ LOG_TOPIC (WARN, Logger::CLUSTER)
1522
+ << " Could not insert documents for restore exception (2): "
1523
+ << ex.what ();
1488
1524
return Result (TRI_ERROR_INTERNAL, ex.what ());
1489
1525
} catch (...) {
1526
+ LOG_TOPIC (WARN, Logger::CLUSTER)
1527
+ << " Could not insert documents for restore exception (3)." ;
1490
1528
return Result (TRI_ERROR_INTERNAL);
1491
1529
}
1492
1530
@@ -1527,15 +1565,34 @@ Result RestReplicationHandler::processRestoreDataBatch(
1527
1565
options.ignoreRevs = true ;
1528
1566
options.isRestore = true ;
1529
1567
options.waitForSync = false ;
1568
+ double startTime = TRI_microtime ();
1530
1569
opRes = trx.replace (collectionName, replBuilder.slice (), options);
1570
+ double duration = TRI_microtime () - startTime;
1531
1571
if (opRes.fail ()) {
1572
+ LOG_TOPIC (WARN, Logger::CLUSTER)
1573
+ << " Could not replace " << replBuilder.slice ().length ()
1574
+ << " documents for restore: "
1575
+ << opRes.result .errorMessage ();
1532
1576
return opRes.result ;
1533
1577
}
1578
+ if (duration > 30 ) {
1579
+ LOG_TOPIC (INFO, Logger::PERFORMANCE) << << " Restored/inserted "
1580
+ << replBuilder.slice ().length () << " documents in time: " << duration
1581
+ << " seconds." ;
1582
+ }
1534
1583
} catch (arangodb::basics::Exception const & ex) {
1584
+ LOG_TOPIC (WARN, Logger::CLUSTER)
1585
+ << " Could not replace documents for restore exception (1): "
1586
+ << ex.what ();
1535
1587
return Result (ex.code (), ex.what ());
1536
1588
} catch (std::exception const & ex) {
1589
+ LOG_TOPIC (WARN, Logger::CLUSTER)
1590
+ << " Could not replace documents for restore exception (2): "
1591
+ << ex.what ();
1537
1592
return Result (TRI_ERROR_INTERNAL, ex.what ());
1538
1593
} catch (...) {
1594
+ LOG_TOPIC (WARN, Logger::CLUSTER)
1595
+ << " Could not replace documents for restore exception (3)." ;
1539
1596
return Result (TRI_ERROR_INTERNAL);
1540
1597
}
1541
1598
0 commit comments