mdbx-test: seeding keygen with actor_id for better spreading.

This commit is contained in:
Leonid Yuriev 2018-09-17 13:21:05 +03:00
parent 01ae5bad7d
commit 844e39ebef
3 changed files with 5 additions and 4 deletions

View File

@ -53,7 +53,7 @@ bool testcase_hill::run() {
*/
/* TODO: работа в несколько потоков */
keyvalue_maker.setup(config.params, 0 /* thread_number */);
keyvalue_maker.setup(config.params, config.actor_id, 0 /* thread_number */);
keygen::buffer a_key = keygen::alloc(config.params.keylen_max);
keygen::buffer a_data_0 = keygen::alloc(config.params.datalen_max);

View File

@ -142,7 +142,7 @@ void __hot maker::pair(serial_t serial, const buffer &key, buffer &value,
}
}
void maker::setup(const config::actor_params_pod &actor,
void maker::setup(const config::actor_params_pod &actor, unsigned actor_id,
unsigned thread_number) {
key_essentials.flags =
actor.table_flags & (MDBX_INTEGERKEY | MDBX_REVERSEKEY | MDBX_DUPSORT);
@ -161,7 +161,7 @@ void maker::setup(const config::actor_params_pod &actor,
assert(thread_number < 2);
(void)thread_number;
mapping = actor.keygen;
salt = actor.keygen.seed * UINT64_C(14653293970879851569);
salt = (actor.keygen.seed + actor_id) * UINT64_C(14653293970879851569);
// FIXME: TODO
base = 0;

View File

@ -119,7 +119,8 @@ public:
void pair(serial_t serial, const buffer &key, buffer &value,
serial_t value_age);
void setup(const config::actor_params_pod &actor, unsigned thread_number);
void setup(const config::actor_params_pod &actor, unsigned actor_id,
unsigned thread_number);
bool increment(serial_t &serial, int delta);
};