mirror of https://gitee.com/bigwinds/arangodb
fixed a bug in create collection in cluster, where transaction result was not checked for success before access (#3137)
This commit is contained in:
parent
d611414682
commit
4c94a1c8ab
|
@ -246,7 +246,6 @@ index_t State::log(query_t const& transactions, size_t ndups) {
|
|||
TRI_ASSERT(nqs > ndups);
|
||||
|
||||
MUTEX_LOCKER(mutexLocker, _logLock); // log entries must stay in order
|
||||
std::string clientId;
|
||||
|
||||
for (size_t i = ndups; i < nqs; ++i) {
|
||||
VPackSlice const& slice = slices[i];
|
||||
|
|
|
@ -1321,7 +1321,6 @@ int ClusterInfo::createCollectionCoordinator(std::string const& databaseName,
|
|||
MUTEX_LOCKER(locker, *cacheMutex);
|
||||
|
||||
auto res = ac.sendTransactionWithFailover(transaction);
|
||||
auto result = res.slice();
|
||||
|
||||
// Only if not precondition failed
|
||||
if (!res.successful()) {
|
||||
|
@ -1329,6 +1328,7 @@ int ClusterInfo::createCollectionCoordinator(std::string const& databaseName,
|
|||
(int)arangodb::rest::ResponseCode::PRECONDITION_FAILED) {
|
||||
AgencyCommResult ag = ac.getValues("/");
|
||||
|
||||
auto result = res.slice();
|
||||
if (result.isArray() && result.length() > 0) {
|
||||
if (result[0].isObject()) {
|
||||
auto tres = result[0];
|
||||
|
@ -1761,7 +1761,7 @@ int ClusterInfo::ensureIndexCoordinator(
|
|||
}
|
||||
}
|
||||
|
||||
if (!planValue) {
|
||||
if (planValue==nullptr) {
|
||||
// hmm :S both empty :S did somebody else clean up? :S
|
||||
// should not happen?
|
||||
return errorCode;
|
||||
|
|
|
@ -893,7 +893,6 @@ int selectivityEstimatesOnCoordinator(
|
|||
if(identifier.value.hasKey("selectivityEstimate")) {
|
||||
StringRef shard_index_id(identifier.key);
|
||||
auto split_point = std::find(shard_index_id.begin(), shard_index_id.end(),'/');
|
||||
std::string shard(shard_index_id.begin(), split_point );
|
||||
std::string index(split_point + 1, shard_index_id.end());
|
||||
|
||||
double estimate = arangodb::basics::VelocyPackHelper::getNumericValue(
|
||||
|
|
Loading…
Reference in New Issue