| 219 | }; |
| 220 | |
| 221 | int |
| 222 | hs_longrun_thread_base::verify_update(const std::string& k, |
| 223 | const std::string& v1, const std::string& v2, const std::string& v3, |
| 224 | record_value& rec, uint32_t num_rows, bool cur_unknown_state) |
| 225 | { |
| 226 | const bool op_success = num_rows == 1; |
| 227 | int ret = 0; |
| 228 | if (!rec.unknown_state) { |
| 229 | if (!rec.deleted && !op_success) { |
| 230 | ++stat.verify_error_count; |
| 231 | if (arg.sh.verbose > 0) { |
| 232 | fprintf(stderr, "VERIFY_ERROR: %s wid=%d k=%s " |
| 233 | "unexpected_update_failure\n", |
| 234 | arg.worker_type.c_str(), arg.id, k.c_str()); |
| 235 | } |
| 236 | ret = 1; |
| 237 | } else if (rec.deleted && op_success) { |
| 238 | ++stat.verify_error_count; |
| 239 | if (arg.sh.verbose > 0) { |
| 240 | fprintf(stderr, "VERIFY_ERROR: %s wid=%d k=%s " |
| 241 | "unexpected_update_success\n", |
| 242 | arg.worker_type.c_str(), arg.id, k.c_str()); |
| 243 | } |
| 244 | ret = 1; |
| 245 | } |
| 246 | } |
| 247 | if (op_success) { |
| 248 | rec.values.resize(4); |
| 249 | rec.values[0] = k; |
| 250 | rec.values[1] = v1; |
| 251 | rec.values[2] = v2; |
| 252 | rec.values[3] = v3; |
| 253 | if (ret == 0 && !rec.unknown_state) { |
| 254 | ++stat.success_count; |
| 255 | } |
| 256 | } |
| 257 | rec.unknown_state = cur_unknown_state; |
| 258 | if (arg.sh.verbose >= 100 && ret == 0) { |
| 259 | fprintf(stderr, "%s %s %s %s %s\n", arg.worker_type.c_str(), |
| 260 | k.c_str(), v1.c_str(), v2.c_str(), v3.c_str()); |
| 261 | } |
| 262 | return ret; |
| 263 | } |
| 264 | |
| 265 | int |
| 266 | hs_longrun_thread_base::verify_read(const std::string& k, |