Skip to content

Fixing time series cascade delete issues.#1572

Merged
rma-rripken merged 29 commits intodevelopfrom
bugfix/1184-ts-cascade-delete
Mar 12, 2026
Merged

Fixing time series cascade delete issues.#1572
rma-rripken merged 29 commits intodevelopfrom
bugfix/1184-ts-cascade-delete

Conversation

@rma-rripken
Copy link
Collaborator

Fixes #1184

@rma-rripken
Copy link
Collaborator Author

The only thing that is left to do (IMO) is to have the create and update either throw an error if the user-provided body includes groups and assignments or to cascade the create/update.

@rma-rripken rma-rripken marked this pull request as ready for review February 9, 2026 18:11
@rma-rripken rma-rripken marked this pull request as draft February 10, 2026 18:32
}

private static volatile DeleteTsGroupCascadeMode deleteTsGroupCascadeMode = DeleteTsGroupCascadeMode.UNKNOWN;
private static final Object deleteTsGroupCascadeModeLock = new Object();
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can and should just synchronize on the deleteTsGroupCascadeMode object. Though maybe only if it isn't volatile, alternatively, maybe use AtomicReference?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I can't synchronize on deleteTsGroupCascadeMode b/c the reference changes. I could switch to holding the mode in an AtomicReference but I think I'd still want another object to synchronize on (could maybe use TimeSeriesGroupDao.class). That block keeps a compound action (test + db call + set) atomic. Although keeping it atomic is probably overkill. What would it matter if two requests both try to call a non-existing procedure as long as they both failover to a method that works? The mode flag was an optimization - once we know which method works we don't need to keep probing and failing-over.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I went ahead and removed the synchronized block. Volatile is good enough given the way we're using the flag.

@rma-rripken
Copy link
Collaborator Author

rma-rripken commented Mar 4, 2026

@MikeNeilson I can apparently assign time series to a CWMS owned group by I can't unassign them. The error I see is:

Caused by: Error : 20048, Position : 0, Sql = BEGIN "CWMS_20"."CWMS_TS"."UNASSIGN_TS_GROUP" (:1 , :2 , :3 , :4 , :5 ) ; END;, OriginalSql = { call "CWMS_20"."CWMS_TS"."UNASSIGN_TS_GROUP" (?, ?, ?, ?, ?) }, Error Msg = ORA-20048: NO_WRITE_PRIVILEGE: User doesnt have write privileges
ORA-06512: at "CWMS_20.CWMS_ERR", line 80
ORA-06512: at "CWMS_20.ST_TS_GROUP_ASSIGNMENT", line 9
ORA-04088: error during execution of trigger 'CWMS_20.ST_TS_GROUP_ASSIGNMENT'
ORA-06512: at "CWMS_20.CWMS_TS", line 10803
ORA-06512: at line 1

If the category/group are owned by CWMS but there are assignments for SPK time series should I (as normal SPK user) be able to unassign those SPK timeseries? Should I be able to unassign non-SPK time series from a CWMS group? Should I be able to create/delete CWMS groups?

@MikeNeilson
Copy link
Contributor

Create/Delete CWMS group: no, those are permanent
Remove offices to which no permissions: no
Remove own timeseries en mass: That does seem reasonable. Just wouldn't be deleting the group, just unassigning for that office.

@rma-rripken
Copy link
Collaborator Author

I've disabled the two tests that deal with CWMS owned groups and created a new issue to resolve that bug.

#1631

@rma-rripken rma-rripken marked this pull request as ready for review March 10, 2026 17:19
@rma-rripken rma-rripken requested a review from MikeNeilson March 10, 2026 17:19
@rma-rripken rma-rripken merged commit 966e443 into develop Mar 12, 2026
9 checks passed
@rma-rripken rma-rripken deleted the bugfix/1184-ts-cascade-delete branch March 12, 2026 22:48
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.

Cacade Delete for Timeseries Group?

2 participants