| 528 | } |
| 529 | |
| 530 | int |
| 531 | hs_longrun_thread_hs::op_delete(record_value& rec) |
| 532 | { |
| 533 | const std::string k = rec.key; |
| 534 | const string_ref op_ref("=", 1); |
| 535 | const string_ref op_args[1] = { |
| 536 | to_string_ref(k), |
| 537 | }; |
| 538 | const string_ref modop_ref("D", 1); |
| 539 | cli->request_buf_exec_generic(0, op_ref, op_args, 1, 1, 0, |
| 540 | modop_ref, 0, 0, 0, 0); |
| 541 | cli->request_send(); |
| 542 | if (check_hs_error("op_delete_send", &rec) != 0) { return 1; } |
| 543 | size_t numflds = 0; |
| 544 | cli->response_recv(numflds); |
| 545 | if (check_hs_error("op_delete_recv", &rec) != 0) { return 1; } |
| 546 | const string_ref *row = cli->get_next_row(); |
| 547 | const bool op_success = (numflds > 0 && row != 0 && |
| 548 | to_string(row[0]) == "1"); |
| 549 | int ret = 0; |
| 550 | if (!rec.unknown_state) { |
| 551 | if (!rec.deleted && !op_success) { |
| 552 | ++stat.verify_error_count; |
| 553 | if (arg.sh.verbose > 0) { |
| 554 | fprintf(stderr, "VERIFY_ERROR: %s wid=%d k=%s " |
| 555 | "unexpected_delete_failure\n", |
| 556 | arg.worker_type.c_str(), arg.id, k.c_str()); |
| 557 | } |
| 558 | ret = 1; |
| 559 | } else if (rec.deleted && op_success) { |
| 560 | ++stat.verify_error_count; |
| 561 | if (arg.sh.verbose > 0) { |
| 562 | fprintf(stderr, "VERIFY_ERROR: %s wid=%d k=%s " |
| 563 | "unexpected_delete_success\n", |
| 564 | arg.worker_type.c_str(), arg.id, k.c_str()); |
| 565 | } |
| 566 | ret = 1; |
| 567 | } |
| 568 | } |
| 569 | cli->response_buf_remove(); |
| 570 | if (op_success) { |
| 571 | rec.deleted = true; |
| 572 | if (ret == 0 && !rec.unknown_state) { |
| 573 | ++stat.success_count; |
| 574 | } |
| 575 | rec.unknown_state = false; |
| 576 | } |
| 577 | if (arg.sh.verbose >= 100 && ret == 0) { |
| 578 | fprintf(stderr, "HS_DELETE %s\n", k.c_str()); |
| 579 | } |
| 580 | return ret; |
| 581 | } |
| 582 | |
| 583 | int |
| 584 | hs_longrun_thread_hs::op_update(record_value& rec) |
nothing calls this directly
no test coverage detected