Skip to content

Commit

Permalink
Merge pull request #2860 from influxdb/config_tags_sort
Browse files Browse the repository at this point in the history
Ensure tags are always marshalled the same way
  • Loading branch information
otoolep committed Jun 10, 2015
2 parents 4545abd + 98d315b commit a4dbed8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tsdb/meta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ func TestMarshalTags(t *testing.T) {
tags: map[string]string{"foo": "bar", "baz": "battttt"},
result: []byte(`baz|foo|battttt|bar`),
},
{
tags: map[string]string{"baz": "battttt", "foo": "bar"},
result: []byte(`baz|foo|battttt|bar`),

This comment has been minimized.

Copy link
@jwilder

jwilder Jun 10, 2015

Contributor

Is this really being used? Tags are already sorted as part of the of the Point.Key. It's a different sort too.

This comment has been minimized.

Copy link
@otoolep

otoolep Jun 10, 2015

Author Contributor

You mean is marshalTags used? Yes, I see it used in tsdb/meta.go. Sounds like we're doubling sorting, since marshalTags also sorts tags keys.

},
} {
result := marshalTags(tt.tags)
if !bytes.Equal(result, tt.result) {
Expand Down

0 comments on commit a4dbed8

Please sign in to comment.