ROX-28315: Add UpdatedAt field to the NetFlows table#14483
Conversation
|
Skipping CI for Draft Pull Request. |
|
Images are ready for the commit at 8ddb721. To use with deploy scripts, first |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #14483 +/- ##
===========================================
- Coverage 49.45% 49.29% -0.16%
===========================================
Files 723 2532 +1809
Lines 72094 185086 +112992
===========================================
+ Hits 35655 91245 +55590
- Misses 33198 86610 +53412
- Partials 3241 7231 +3990
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
4b8ae34 to
bb4e156
Compare
bb4e156 to
d32ab30
Compare
d32ab30 to
c49386c
Compare
migrator/migrations/m_209_to_m_210_add_updated_at_to_network_flows_v2/migration_impl.go
Outdated
Show resolved
Hide resolved
migrator/migrations/m_209_to_m_210_add_updated_at_to_network_flows_v2/migration_impl.go
Outdated
Show resolved
Hide resolved
migrator/migrations/m_209_to_m_210_add_updated_at_to_network_flows_v2/stores/previous/store.go
Show resolved
Hide resolved
central/networkgraph/flow/datastore/internal/store/postgres/store.go
Outdated
Show resolved
Hide resolved
migrator/migrations/m_209_to_m_210_add_updated_at_to_network_flows_v2/migration_impl.go
Show resolved
Hide resolved
central/networkgraph/flow/datastore/internal/store/postgres/store.go
Outdated
Show resolved
Hide resolved
mtodor
left a comment
There was a problem hiding this comment.
Nice work! Added a few comments related to some edge cases.
central/networkgraph/flow/datastore/internal/store/postgres/store.go
Outdated
Show resolved
Hide resolved
central/networkgraph/flow/datastore/internal/store/postgres/store.go
Outdated
Show resolved
Hide resolved
|
@lvalerom: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Description
This PR aims to fix an edge case where we do not received a NetworkFlow with the
LastSeenTimestampset and the flow is received after the deployment was deleted.A little bit of context:
LastSeenTimestampbeing set.The bug:
Sometimes we might never receive the updated flows with
LastSeenTimestampset. This could happen because Collector/Sensor failed to process theLastSeenTimestamp(#14538 will improve on that) or simply the message was lost and never arrived to Central (e.g. Sensor restarted and lost all the information about the flows).An example step by step of the bug:
LastSeenTimestamp.LastSeenTimestamp(Maybe Sensor restarted for some reason or collector failed to send the information).The solution:
UpdatedAtto the NetworkFlows table.UpdatedAtfield instead of theLastSeenTimestamp.User-facing documentation
Testing and quality
Automated testing
How I validated my change
select * from network_flows_v2 where updatedat is null;should return zeroUpdatedAtfield toNULL:select * from network_flows_v2 where updatedat is null;should return some flowsUpdatedAtunset:select * from network_flows_v2 where updatedat is null;should return zero