fix: catch DynamoDB Scan error when trying to scan nonexistent table/index in syncLeases()
Signed-off-by: Shiva Pentakota <spentakota@vmware.com>
This commit is contained in:
parent
c862165130
commit
08b7fd9447
10 changed files with 18 additions and 13 deletions
|
|
@ -20,7 +20,7 @@
|
||||||
// Package checkpoint
|
// Package checkpoint
|
||||||
// The implementation is derived from https://github.com/patrobinson/gokini
|
// The implementation is derived from https://github.com/patrobinson/gokini
|
||||||
//
|
//
|
||||||
// Copyright 2018 Patrick robinson
|
// # Copyright 2018 Patrick robinson
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
// Package checkpoint
|
// Package checkpoint
|
||||||
// The implementation is derived from https://github.com/patrobinson/gokini
|
// The implementation is derived from https://github.com/patrobinson/gokini
|
||||||
//
|
//
|
||||||
// Copyright 2018 Patrick robinson
|
// # Copyright 2018 Patrick robinson
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
//
|
//
|
||||||
|
|
@ -441,6 +441,12 @@ func (checkpointer *DynamoCheckpoint) syncLeases(shardStatus map[string]*par.Sha
|
||||||
}
|
}
|
||||||
|
|
||||||
scanOutput, err := checkpointer.svc.Scan(context.TODO(), input)
|
scanOutput, err := checkpointer.svc.Scan(context.TODO(), input)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Debugf("Error performing DynamoDB Scan. Error: %+v ", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
results := scanOutput.Items
|
results := scanOutput.Items
|
||||||
for _, result := range results {
|
for _, result := range results {
|
||||||
shardId, foundShardId := result[LeaseKeyKey]
|
shardId, foundShardId := result[LeaseKeyKey]
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
// The implementation is derived from https://github.com/patrobinson/gokini
|
// The implementation is derived from https://github.com/patrobinson/gokini
|
||||||
//
|
//
|
||||||
// Copyright 2018 Patrick robinson
|
// # Copyright 2018 Patrick robinson
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
// Package cloudwatch
|
// Package cloudwatch
|
||||||
// The implementation is derived from https://github.com/patrobinson/gokini
|
// The implementation is derived from https://github.com/patrobinson/gokini
|
||||||
//
|
//
|
||||||
// Copyright 2018 Patrick robinson
|
// # Copyright 2018 Patrick robinson
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
// Package metrics
|
// Package metrics
|
||||||
// The implementation is derived from https://github.com/patrobinson/gokini
|
// The implementation is derived from https://github.com/patrobinson/gokini
|
||||||
//
|
//
|
||||||
// Copyright 2018 Patrick robinson
|
// # Copyright 2018 Patrick robinson
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
// Package prometheus
|
// Package prometheus
|
||||||
// The implementation is derived from https://github.com/patrobinson/gokini
|
// The implementation is derived from https://github.com/patrobinson/gokini
|
||||||
//
|
//
|
||||||
// Copyright 2018 Patrick robinson
|
// # Copyright 2018 Patrick robinson
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
// Package partition
|
// Package partition
|
||||||
// The implementation is derived from https://github.com/patrobinson/gokini
|
// The implementation is derived from https://github.com/patrobinson/gokini
|
||||||
//
|
//
|
||||||
// Copyright 2018 Patrick robinson
|
// # Copyright 2018 Patrick robinson
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
// Package worker
|
// Package worker
|
||||||
// The implementation is derived from https://github.com/patrobinson/gokini
|
// The implementation is derived from https://github.com/patrobinson/gokini
|
||||||
//
|
//
|
||||||
// Copyright 2018 Patrick robinson
|
// # Copyright 2018 Patrick robinson
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
// Package worker
|
// Package worker
|
||||||
// The implementation is derived from https://github.com/patrobinson/gokini
|
// The implementation is derived from https://github.com/patrobinson/gokini
|
||||||
//
|
//
|
||||||
// Copyright 2018 Patrick robinson
|
// # Copyright 2018 Patrick robinson
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
//
|
//
|
||||||
|
|
@ -49,9 +49,9 @@ import (
|
||||||
par "github.com/vmware/vmware-go-kcl-v2/clientlibrary/partition"
|
par "github.com/vmware/vmware-go-kcl-v2/clientlibrary/partition"
|
||||||
)
|
)
|
||||||
|
|
||||||
//Worker is the high level class that Kinesis applications use to start processing data. It initializes and oversees
|
// Worker is the high level class that Kinesis applications use to start processing data. It initializes and oversees
|
||||||
//different components (e.g. syncing shard and lease information, tracking shard assignments, and processing data from
|
// different components (e.g. syncing shard and lease information, tracking shard assignments, and processing data from
|
||||||
//the shards).
|
// the shards).
|
||||||
type Worker struct {
|
type Worker struct {
|
||||||
streamName string
|
streamName string
|
||||||
regionName string
|
regionName string
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,6 @@ type ZapLogger struct {
|
||||||
//
|
//
|
||||||
// Base zap logger can be convert to SugaredLogger by calling to add a wrapper:
|
// Base zap logger can be convert to SugaredLogger by calling to add a wrapper:
|
||||||
// sugaredLogger := log.Sugar()
|
// sugaredLogger := log.Sugar()
|
||||||
//
|
|
||||||
func NewZapLogger(logger *uzap.SugaredLogger) logger.Logger {
|
func NewZapLogger(logger *uzap.SugaredLogger) logger.Logger {
|
||||||
return &ZapLogger{
|
return &ZapLogger{
|
||||||
sugaredLogger: logger,
|
sugaredLogger: logger,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue