open-consul/agent/consul/state
Chris Piraino baad708929
Fix bug in usage metrics when multiple service instances are changed in a single transaction (#9440)
* Fix bug in usage metrics that caused a negative count to occur

There were a couple of instances were usage metrics would do the wrong
thing and result in incorrect counts, causing the count to attempt to
decrement below zero and return an error. The usage metrics did not
account for various places where a single transaction could
delete/update/add multiple service instances at once.

We also remove the error when attempting to decrement below zero, and
instead just make sure we do not accidentally underflow the unsigned
integer. This is a more graceful failure than returning an error and not
allowing a transaction to commit.

* Add changelog
2021-01-12 15:31:47 -06:00
..
acl.go acl: global tokens created by auth methods now correctly replicate to secondary datacenters (#9351) 2020-12-09 15:22:29 -06:00
acl_events.go stream: Improve docstrings 2020-07-14 15:57:47 -04:00
acl_events_test.go acl: global tokens created by auth methods now correctly replicate to secondary datacenters (#9351) 2020-12-09 15:22:29 -06:00
acl_oss.go state: convert the remaining functions to ReadTxn 2020-10-23 14:29:22 -04:00
acl_test.go acl: global tokens created by auth methods now correctly replicate to secondary datacenters (#9351) 2020-12-09 15:22:29 -06:00
autopilot.go Switch to using the external autopilot module 2020-11-09 09:22:11 -05:00
autopilot_test.go Switch to using the external autopilot module 2020-11-09 09:22:11 -05:00
catalog.go Add a paramter in state store methods to indicate whether a resource insertion is from a snapshot restoration (#9156) 2020-11-11 11:21:42 -05:00
catalog_events.go stream: document that Payload must be immutable 2020-11-06 13:00:33 -05:00
catalog_events_test.go Merge pull request #9114 from hashicorp/dnephin/filtering-in-stream 2020-11-16 14:20:07 -05:00
catalog_oss.go Add a paramter in state store methods to indicate whether a resource insertion is from a snapshot restoration (#9156) 2020-11-11 11:21:42 -05:00
catalog_test.go testing: skip slow tests with -short 2020-12-07 13:42:55 -05:00
config_entry.go structs: Fix printing of IDs 2021-01-07 18:47:38 -05:00
config_entry_intention.go state: convert the remaining functions to ReadTxn 2020-10-23 14:29:22 -04:00
config_entry_intention_oss.go connect: intentions are now managed as a new config entry kind "service-intentions" (#8834) 2020-10-06 13:24:05 -05:00
config_entry_oss.go connect: intentions are now managed as a new config entry kind "service-intentions" (#8834) 2020-10-06 13:24:05 -05:00
config_entry_test.go connect: support defining intentions using layer 7 criteria (#8839) 2020-10-06 17:09:13 -05:00
connect_ca.go state: convert the remaining functions to ReadTxn 2020-10-23 14:29:22 -04:00
connect_ca_test.go state: track changes so that they may be used to produce change events 2020-06-16 13:04:29 -04:00
coordinate.go Merge pull request #8070 from hashicorp/dnephin/add-gofmt-simplify 2020-06-16 17:18:38 -04:00
coordinate_test.go testing: skip slow tests with -short 2020-12-07 13:42:55 -05:00
delay_oss.go upstream some differences from enterprise (#8902) 2020-10-09 09:42:53 -05:00
delay_test.go testing: skip slow tests with -short 2020-12-07 13:42:55 -05:00
federation_state.go state: convert the remaining functions to ReadTxn 2020-10-23 14:29:22 -04:00
graveyard.go state: convert the remaining functions to ReadTxn 2020-10-23 14:29:22 -04:00
graveyard_oss.go state: convert the remaining functions to ReadTxn 2020-10-23 14:29:22 -04:00
graveyard_test.go testing: skip slow tests with -short 2020-12-07 13:42:55 -05:00
index_connect.go Add Proxy Upstreams to Service Definition (#4639) 2018-10-10 16:55:34 +01:00
index_connect_test.go Add Proxy Upstreams to Service Definition (#4639) 2018-10-10 16:55:34 +01:00
index_service_kind.go Implement Mesh Gateways 2019-07-01 16:28:30 -04:00
intention.go server: remove config entry CAS in legacy intention API bridge code (#9151) 2020-11-13 14:42:21 -06:00
intention_oss.go state: convert the remaining functions to ReadTxn 2020-10-23 14:29:22 -04:00
intention_test.go server: remove config entry CAS in legacy intention API bridge code (#9151) 2020-11-13 14:42:21 -06:00
kvs.go Add a paramter in state store methods to indicate whether a resource insertion is from a snapshot restoration (#9156) 2020-11-11 11:21:42 -05:00
kvs_oss.go Add a paramter in state store methods to indicate whether a resource insertion is from a snapshot restoration (#9156) 2020-11-11 11:21:42 -05:00
kvs_test.go stream: Use a no-op event publisher if streaming is disabled 2020-10-28 13:54:19 -04:00
memdb.go stream: Use a no-op event publisher if streaming is disabled 2020-10-28 13:54:19 -04:00
operations_oss.go Use ReadTxn interface in state store helper functions 2020-09-02 10:24:20 -05:00
prepared_query.go state: convert the remaining functions to ReadTxn 2020-10-23 14:29:22 -04:00
prepared_query_index.go pkg refactor 2017-06-10 18:52:45 +02:00
prepared_query_index_test.go agent: move agent/consul/structs to agent/structs 2017-08-09 14:32:12 +02:00
prepared_query_test.go testing: skip slow tests with -short 2020-12-07 13:42:55 -05:00
schema.go Enable gofmt simplify 2020-06-16 13:21:11 -04:00
schema_test.go pkg refactor 2017-06-10 18:52:45 +02:00
session.go Add a paramter in state store methods to indicate whether a resource insertion is from a snapshot restoration (#9156) 2020-11-11 11:21:42 -05:00
session_oss.go Add a paramter in state store methods to indicate whether a resource insertion is from a snapshot restoration (#9156) 2020-11-11 11:21:42 -05:00
session_test.go testing: skip slow tests with -short 2020-12-07 13:42:55 -05:00
state_store.go stream: Use a no-op event publisher if streaming is disabled 2020-10-28 13:54:19 -04:00
state_store_oss_test.go Updates to Config Entries and Connect for Namespaces (#7116) 2020-01-24 10:04:58 -05:00
state_store_test.go stream: Use a no-op event publisher if streaming is disabled 2020-10-28 13:54:19 -04:00
store_integration_test.go testing: skip slow tests with -short 2020-12-07 13:42:55 -05:00
system_metadata.go server: create new memdb table for storing system metadata (#8703) 2020-10-06 10:08:37 -05:00
system_metadata_test.go server: create new memdb table for storing system metadata (#8703) 2020-10-06 10:08:37 -05:00
tombstone_gc.go Sheds monotonic time info so tombstone GC bins work properly. 2017-11-29 10:34:24 -08:00
tombstone_gc_test.go Sheds monotonic time info so tombstone GC bins work properly. 2017-11-29 10:34:24 -08:00
txn.go state: convert the remaining functions to ReadTxn 2020-10-23 14:29:22 -04:00
txn_test.go connect: intentions are now managed as a new config entry kind "service-intentions" (#8834) 2020-10-06 13:24:05 -05:00
usage.go Fix bug in usage metrics when multiple service instances are changed in a single transaction (#9440) 2021-01-12 15:31:47 -06:00
usage_oss.go Fix bug in usage metrics when multiple service instances are changed in a single transaction (#9440) 2021-01-12 15:31:47 -06:00
usage_oss_test.go Add new usage memdb table that tracks usage counts of various elements 2020-09-02 10:24:16 -05:00
usage_test.go Fix bug in usage metrics when multiple service instances are changed in a single transaction (#9440) 2021-01-12 15:31:47 -06:00