Skip to content

NewIterator search bug, cannot retrieve the key within range #448

@spidemen2024

Description

@spidemen2024

the target key is accept_event_time_1737076247294351463

the start key is accept_event_time_1737076245000000000.
the end key is accept_event_time_1737076249000000000,

but the result still not get accept_event_time_1737076247294351463 to return. when you try to get accept_event_time_1737076247294351463, it does return.

// Convert startTime and endTime to big.Int
	startBigInt := big.NewInt(startTime)
	endBigInt := big.NewInt(endTime)

	// 1 second = 1000000000 ns
	startBigInt.Mul(startBigInt, big.NewInt(1000000000))
	endBigInt.Mul(endBigInt, big.NewInt(1000000000))

	// 1 second = 1000000000 ns
	startKey := []byte(AcceptRequestEventTimeKey + "_" + startBigInt.String())
	endKey := []byte(AcceptRequestEventTimeKey + "_" + endBigInt.String())

	var events []utils.Event
	iter := c.WorkerDB.NewIterator(&util.Range{Start: startKey, Limit: endKey}, &opt.ReadOptions{})
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions