talariadb / talaria

TalariaDB is a distributed, highly available, and low latency time-series database for Presto
MIT License
215 stars 31 forks source link

Azure write failed after Sink version #113

Closed atlas-comstock closed 2 years ago

atlas-comstock commented 2 years ago
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1a01854]

goroutine 262480 [running]:
github.com/kelindar/talaria/internal/storage/writer/base.(*Writer).Encode(0x4030b02100, {0x1be0480, 0x401068de30})
        /go/src/talaria/internal/storage/writer/base/base.go:89 +0x94
github.com/kelindar/talaria/internal/storage/writer/azure.(*MultiAccountWriter).Write(0x4030b0c000, {0x4000f1b480, 0x7f, 0x80}, {0x4011360000, 0x49, 0x87})
        /go/src/talaria/internal/storage/writer/azure/azure.go:220 +0x80
github.com/kelindar/talaria/internal/storage/writer/multi.(*Writer).Write.func1()
        /go/src/talaria/internal/storage/writer/multi/multi.go:50 +0x60
golang.org/x/sync/errgroup.(*Group).Go.func1(0x40113a02a0, 0x40103007d0)
        /go/src/talaria/vendor/golang.org/x/sync/errgroup/errgroup.go:57 +0x58
created by golang.org/x/sync/errgroup.(*Group).Go
atlas-comstock commented 2 years ago

@tardunge for more info

atlas-comstock commented 2 years ago

I figured out the issue... Args order not matched, which is quite common pitfall:

w, err := azure.NewMultiAccountWriter(monitor, config.Azure.BlobServiceURL, config.Azure.Container, config.Azure.Prefix, config.Azure.Filter, config.Azure.Encoder, config.Azure.StorageAccounts, config.Azure.StorageAccountWeights, config.Azure.Parallelism, config.Azure.BlockSize)
func NewMultiAccountWriter(monitor monitor.Monitor, filter, encoding, blobServiceURL, container, prefix string, storageAccount []string, weights []uint, parallelism uint16, blockSize int64) (*MultiAccountWriter, error) {
tardunge commented 2 years ago

Yeah, the order of args is mismatched. We should have good test cases.

tardunge commented 2 years ago

Addressed in MR 110 https://github.com/talariadb/talaria/pull/110/commits/0f47c978e3f0276bf586d4f617cdc0e69d60ec07