| 6958 | } |
| 6959 | |
| 6960 | bool rkThrottlingCooledDown(DatabaseContext* cx, TransactionPriority priority) { |
| 6961 | if (priority == TransactionPriority::IMMEDIATE) { |
| 6962 | return true; |
| 6963 | } else if (priority == TransactionPriority::BATCH) { |
| 6964 | if (cx->lastRkBatchThrottleTime == 0.0) { |
| 6965 | return true; |
| 6966 | } |
| 6967 | return (now() - cx->lastRkBatchThrottleTime > CLIENT_KNOBS->GRV_CACHE_RK_COOLDOWN); |
| 6968 | } else if (priority == TransactionPriority::DEFAULT) { |
| 6969 | if (cx->lastRkDefaultThrottleTime == 0.0) { |
| 6970 | return true; |
| 6971 | } |
| 6972 | return (now() - cx->lastRkDefaultThrottleTime > CLIENT_KNOBS->GRV_CACHE_RK_COOLDOWN); |
| 6973 | } |
| 6974 | return false; |
| 6975 | } |
| 6976 | |
| 6977 | Future<Version> Transaction::getReadVersion(uint32_t flags) { |
| 6978 | if (!readVersion.isValid()) { |