Skip to content

FOGL-8285 : Added new JSONB field in streams table#1455

Open
gnandan wants to merge 20 commits intodevelopfrom
FOGL-8285_1
Open

FOGL-8285 : Added new JSONB field in streams table#1455
gnandan wants to merge 20 commits intodevelopfrom
FOGL-8285_1

Conversation

@gnandan
Copy link
Member

@gnandan gnandan commented Aug 28, 2024

This implementation is done only for north service. Will implement changes for north task later

@gnandan gnandan marked this pull request as ready for review September 19, 2024 09:28
@MarkRiddoch
Copy link
Contributor

Have we run all the system tests against this branch?

@gnandan
Copy link
Member Author

gnandan commented Oct 8, 2024

Have we run all the system tests against this branch?

Only system tests have been executed against it. Will run labscripts and verify for upgrade case as well

@gnandan
Copy link
Member Author

gnandan commented Nov 28, 2024

Have we run all the system tests against this branch?

Only system tests have been executed against it. Will run labscripts and verify for upgrade case as well

I executed system tests, lab scripts using CI Jobs and did some manual testing. Please refer following sheet for detailed report https://docs.google.com/spreadsheets/d/1m5JEiAd1BBo4FTlvuTVI1f_F1tON8E3X7P2bdqXhfbo/edit?usp=sharing

Copy link
Contributor

@MarkRiddoch MarkRiddoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change concerns me a lot. It is such an extrenely unlikely thing for a real user to ever do, change the data source they are sending to a given destination after they have sent data already, that I woud be more inclined to disallow the change rather than put code it that tries to deal with it. Especially when this is a very sensitive area of the code. It controls the dat asent to a given destination and is responsible for making sure we don't miss data or resed data. At the very least it requires considerable testing of lots of different scenarios.
My feeing is we do not make this change.

/**
* Migrate data of last_object field of streams table to new field last_objects
*/
void DataLoad::migrateStats()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nothing to do with stats, it is the position in the stream. The object ID's in a stream are not by defintion continuous, therefore making the assumption they are is dangerous. Consider for example cases of filter pipelines in the north that remove readings fom the stream.

Copy link
Contributor

@MarkRiddoch MarkRiddoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the upgrade is not good enough to apply to a real system that might be sending north and will replay readings, which it should not do. The issue that is trying to be fixed here is very niche and probably not one that would be encountered or is even worth trying to deal with. It is probably better to make the source immutable once created and force a new north to be created if you want to send different data.

@@ -0,0 +1 @@
ALTER TABLE fledge.streams ADD COLUMN last_objects jsonb NOT NULL DEFAULT '{"Readings":0,"Stats":0,"Audit":0}'::jsonb;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The is not preserving the current point reached in the readings being sent north. This will be an issue for upgrade of a running system.

@@ -0,0 +1 @@
ALTER TABLE fledge.streams ADD COLUMN last_objects JSON NOT NULL DEFAULT '{"Readings":0,"Stats":0,"Audit":0}';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, the current position is lost so this will cause issues.

@@ -0,0 +1 @@
ALTER TABLE fledge.streams ADD COLUMN last_objects JSON NOT NULL DEFAULT '{"Readings":0,"Stats":0,"Audit":0}';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As with other upgrader scripts, this does not preserve the location in the readings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants