vendor: update tsdb

This commit is contained in:
Fabian Reinartz 2018-03-14 10:01:27 -04:00
parent 0847a605a7
commit a947750dd6
5 changed files with 31 additions and 18 deletions

View file

@ -0,0 +1,5 @@
// +build windows
package fileutil
const maxMapSize = 0x7FFFFFFF // 2GB

View file

@ -0,0 +1,5 @@
// +build windows
package fileutil
const maxMapSize = 0xFFFFFFFFFFFF // 256TB

View file

@ -19,14 +19,14 @@ import (
"unsafe"
)
func mmap(f *os.File, sz int) ([]byte, error) {
low, high := uint32(sz), uint32(sz>>32)
func mmap(f *os.File, size int) ([]byte, error) {
low, high := uint32(size), uint32(size>>32)
h, errno := syscall.CreateFileMapping(syscall.Handle(f.Fd()), nil, syscall.PAGE_READONLY, high, low, nil)
if h == 0 {
return nil, os.NewSyscallError("CreateFileMapping", errno)
}
addr, errno := syscall.MapViewOfFile(h, syscall.FILE_MAP_READ, 0, 0, uintptr(sz))
addr, errno := syscall.MapViewOfFile(h, syscall.FILE_MAP_READ, 0, 0, uintptr(size))
if addr == 0 {
return nil, os.NewSyscallError("MapViewOfFile", errno)
}
@ -35,7 +35,7 @@ func mmap(f *os.File, sz int) ([]byte, error) {
return nil, os.NewSyscallError("CloseHandle", err)
}
return (*[1 << 30]byte)(unsafe.Pointer(addr))[:sz], nil
return (*[maxMapSize]byte)(unsafe.Pointer(addr))[:size], nil
}
func munmap(b []byte) error {

View file

@ -61,6 +61,9 @@ func repairBadIndexVersion(logger log.Logger, dir string) error {
if err := repl.Close(); err != nil {
return err
}
if err := broken.Close(); err != nil {
return err
}
if err := renameFile(repl.Name(), broken.Name()); err != nil {
return err
}

28
vendor/vendor.json vendored
View file

@ -800,40 +800,40 @@
"revisionTime": "2016-04-11T19:08:41Z"
},
{
"checksumSHA1": "JfxP001vgt0P+hEDk/if0bxa8xU=",
"checksumSHA1": "vNslgGjRBqauFmVIBTkvEWwvURg=",
"path": "github.com/prometheus/tsdb",
"revision": "00404ae5ab578bb550377a17aab5511deb0592c5",
"revisionTime": "2018-03-13T20:20:03Z"
"revision": "659ed644294eec6310cef0685b002a3aed8c8f85",
"revisionTime": "2018-03-14T13:49:50Z"
},
{
"checksumSHA1": "S7F4yWxVLhxQNHMdgoOo6plmOOs=",
"path": "github.com/prometheus/tsdb/chunkenc",
"revision": "00404ae5ab578bb550377a17aab5511deb0592c5",
"revisionTime": "2018-03-13T20:20:03Z"
"revision": "659ed644294eec6310cef0685b002a3aed8c8f85",
"revisionTime": "2018-03-14T13:49:50Z"
},
{
"checksumSHA1": "+zsn1i8cqwgZXL8Bg6jDy32xjAo=",
"path": "github.com/prometheus/tsdb/chunks",
"revision": "00404ae5ab578bb550377a17aab5511deb0592c5",
"revisionTime": "2018-03-13T20:20:03Z"
"revision": "659ed644294eec6310cef0685b002a3aed8c8f85",
"revisionTime": "2018-03-14T13:49:50Z"
},
{
"checksumSHA1": "h49AAcJ5+iRBwCgbfQf+2T1E1ZE=",
"checksumSHA1": "T7qvg4VhFLklT3g+qPkUWxBo0yw=",
"path": "github.com/prometheus/tsdb/fileutil",
"revision": "00404ae5ab578bb550377a17aab5511deb0592c5",
"revisionTime": "2018-03-13T20:20:03Z"
"revision": "659ed644294eec6310cef0685b002a3aed8c8f85",
"revisionTime": "2018-03-14T13:49:50Z"
},
{
"checksumSHA1": "4ebzIE2Jvj6+SG6yGFSXN8scgfo=",
"path": "github.com/prometheus/tsdb/index",
"revision": "00404ae5ab578bb550377a17aab5511deb0592c5",
"revisionTime": "2018-03-13T20:20:03Z"
"revision": "659ed644294eec6310cef0685b002a3aed8c8f85",
"revisionTime": "2018-03-14T13:49:50Z"
},
{
"checksumSHA1": "Va8HWvOFTwFeewZFadMAOzNGDps=",
"path": "github.com/prometheus/tsdb/labels",
"revision": "00404ae5ab578bb550377a17aab5511deb0592c5",
"revisionTime": "2018-03-13T20:20:03Z"
"revision": "659ed644294eec6310cef0685b002a3aed8c8f85",
"revisionTime": "2018-03-14T13:49:50Z"
},
{
"checksumSHA1": "5SYLEhADhdBVZAGPVHWggQl7H8k=",