Skip to content

Duplicate user in search_users temp table when label, values range from 0...N #242

@eozturk1

Description

@eozturk1

Encountered this while doing some tests (bench code]:

pub fn generate_key_entries(num_entries: u64) -> Vec<(AkdLabel, AkdValue)> {
    let mut label = BytesMut::with_capacity(LABEL_VALUE_SIZE_BYTES);
    let mut value = BytesMut::with_capacity(LABEL_VALUE_SIZE_BYTES);

    (0..num_entries)
        .map(|i| {
            label.put_u64(i);
            label.resize(LABEL_VALUE_SIZE_BYTES, 0u8);
            let l = label.split().freeze();

            value.put_u64(i);
            value.resize(LABEL_VALUE_SIZE_BYTES, 0u8);
            let v = value.split().freeze();

            (AkdLabel(l.to_vec()), AkdValue(v.to_vec()))
        })
        .collect()

results in duplicate user errors in the temp table we create in MySQL (search_users).

I isolated the code in here to see whether there are any duplicates but that is not the case (including in only-labels).

Creating this issue to track this further.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions