ipfs / ipfs/kubo

Sharding breaks sorting on gateway

Open
#4,570 4 comments 0 reactions 0 assignees View on GitHub
kind/bug topic/gateway
Dominant language
Go
Stars
17.1k
Forks
3.2k
Avg merge
3d 18h
Merged PRs (30d)
11

Description

#### Version information:
```
go-ipfs version: 0.4.13-
Repo version: 6
System version: amd64/linux
Golang version: go1.9.2
```

#### Type:
Bug

#### Severity:
Low
#### Description:

I have the following directory structrure:

```
.
├── a
├── b
├── c
└── f

4 directories, 0 files
```

If I add this with sharding disabled, I get this:

```
added QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn t/a
added QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn t/b
added QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn t/c
added QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn t/f
added QmZ2EQQs5XWXazqbnqXB67ZAhGzkEZzDTM9MY2R3mr9251 t
```

This is how it looks on the gateway:

![image](https://user-images.githubusercontent.com/459764/34735958-3c057272-f569-11e7-8542-408a2c1c1523.png)

If I activate sharding and add it again, I get this:

```
added QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn t/a
added QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn t/b
added QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn t/c
added QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn t/f
added QmaY2Hm1WfweGcsn2WuyFAUfPJqfFH9giMtZHezvPjNgHe t
```

And now the gateway looks like this:

![image](https://user-images.githubusercontent.com/459764/34736042-87c932ca-f569-11e7-8e0a-7c2f37157fd4.png)

Notice that the order changed from:

- a
- b
- c
- f

To

- b
- a
- c
- f

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.