iiasa / ixmp

The ix modeling platform for integrated and cross-cutting scenario analysis
https://docs.messageix.org/ixmp
Apache License 2.0
38 stars 112 forks source link

Add feature to unlock `Timeseries`/`Scenarios` in a database #30

Open danielhuppmann opened 6 years ago

danielhuppmann commented 6 years ago

When checking out an ixmp.Scenario and not committing or discarding (or running into an error), the run-id is locked in the database instance. We need an elegant way to 'unlock' the run-id.

Follow-up: this should only be available to admins on central/shared database instance?

danielhuppmann commented 6 years ago

A current workaround is to open the underlying database and, in table RUN, set the status column in the row for the id to 1.

khaeru commented 4 years ago

30 was reported as a duplicate. I left this comment, copied below to consolidate.

Backend API docs, for reference.

Some thoughts:

zikolach commented 4 years ago

ixmp lacks anything like ROLLBACK

there is discard_changes method

git checkout modifies or reverts the working tree

It is incorrect comparison, the semantics of checkout in ixmp is locking of scenario version to make changes. More appropriate would be to compare with svn lock.

In general I agree that the logic is complicated and possibly needs to be simplified. But it is incorrect to compare it with database/SQL transaction model as it has to be hidden from end user.

khaeru commented 3 years ago

Unassigned, as this has gone on to the back burner.

gidden commented 2 years ago

Hi all, I am now running into this issue again when trying to launch multiple runs of message.

In my use case, I am strictly cloneing (i.e., read-only copying) a base scenario to launch multiple derivatives (in this case different kinds of climate targets).

Can someone advise on the current preferred pythonic solution for this scenario?

cc @LauWien @OFR-IIASA

gidden commented 2 years ago

This sounds like it should come back to the front burner. We now have multiple user reports around this issue (see slack channel #message_general).

I have made a similar (though not duplicate precisely) issue in #437

khaeru commented 2 years ago

At #437 it was suggested:

The simplest way around this is to place a read-only status on scenario instances. These would not lock the scenario, but also would not allow changes. They would therefore be robust against unexpected system exits.

Something similar was was attempted in iiasa/ixmp_source#334 for iiasa/ixmp#350. We found that a pure-Python fix for the issue was not possible. I was supporting there, but once we lost our Java development capabilities, it stalled, and has not gone further.

so would suggest making this a high priority.

If it is to be high priority, then that Java dev capability must be found so that we have someone with the time and skills to make the necessary changes in ixmp_source.