Enable construction of TruncIndex from id array.
Fixes #5166 Current graph.restore is essentially O(n^2 log n) due to how suffixarray creation works. Rather than create/append/create new this supports creation from a seed array of ids. Functional testing shows this eliminates the hang on Creating image graph reported on list. Docker-DCO-1.1-Signed-off-by: Paul Nasrat <pnasrat@gmail.com> (github: pnasrat) Upstream-commit: 4f169c2db512d2ea9ed5729df375896a1ee90347 Component: engine
This commit is contained in:
@ -138,7 +138,8 @@ func TestRaceWriteBroadcaster(t *testing.T) {
|
||||
|
||||
// Test the behavior of TruncIndex, an index for querying IDs from a non-conflicting prefix.
|
||||
func TestTruncIndex(t *testing.T) {
|
||||
index := NewTruncIndex()
|
||||
ids := []string{}
|
||||
index := NewTruncIndex(ids)
|
||||
// Get on an empty index
|
||||
if _, err := index.Get("foobar"); err == nil {
|
||||
t.Fatal("Get on an empty index should return an error")
|
||||
|
||||
Reference in New Issue
Block a user