Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change run deletion (session/synchronize) #1374

Merged
merged 1 commit into from
Feb 22, 2018

Conversation

gyorb
Copy link
Contributor

@gyorb gyorb commented Feb 15, 2018

  • use separate sessions for each run deletion
  • wich the synchronize_session=False deletion can be speed up
    because we do not need the runs in the session anymore,
    just cleaning up everything

@gyorb gyorb added the database 🗄️ Issues related to the database schema. label Feb 15, 2018
@gyorb gyorb added this to the release 6.5.1 milestone Feb 15, 2018
LOG.error("Failed to remove run: " + str(run_id))
LOG.error(ex)
failed = True
continue
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it necessary to call continue here? Couldn't we remove it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it it not needed there

* use separate sessions for each run deletion
* wich the synchronize_session=False deletion can be speed up
  because we do not need the runs in the session anymore,
  just cleaning up everything
@Xazax-hun
Copy link
Contributor

What is the reason to use separate sessions? I am not against it, just curious.

@gyorb
Copy link
Contributor Author

gyorb commented Feb 16, 2018

@Xazax-hun I prefer to do the database modification in smaller chunks instead of building one big session with a lot of modifications.
Closing the session after each delete will release transaction and connection resources, it might increase the performance but I did not measure that separately (less states to manage in the session, database can cleanup transaction related data).
However performance improvement is done with the usage of the synchronize_session=False flag which we can use here because we do not need the data in the session anymore.

@Xazax-hun
Copy link
Contributor

Having a separate transaction for each delete is definitely a good idea. But I wonder if reconnecting for each delete is good. But I am fine with that.

@csordasmarton csordasmarton merged commit fd2df38 into Ericsson:master Feb 22, 2018
@gyorb gyorb deleted the dev-delete branch May 18, 2018 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database 🗄️ Issues related to the database schema.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants