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

[BUG] Importing a large amount of monitoring config occur poor experience and may trigger a long database transaction #3003

Open
1 task done
MasamiYui opened this issue Jan 20, 2025 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@MasamiYui
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I imported 500 monitoring configuration files, it took 8 minutes.

Expected Behavior

During this time, I didn’t see any data increase on the monitoring center list page, which made me suspect if the process was stuck.

Steps To Reproduce

1.Enter 'monitors' from left menu
2.Select 'Import Monitor'
3.Import a large monitor config file
4.Waiting long time,no data increase

Environment

HertzBeat version(s):1.6.1

Debug logs

No response

Anything else?

I found that MonitorServiceImpl.java used @transactional at the class level,
@Transactional(rollbackFor = Exception.class) public class MonitorServiceImpl implements MonitorService

This occur a poor experience and was unnecessary.

If each configuration import was treated as a separate transaction, I would have seen the data being imported continuously, making me feel that the process was working.

The same issue might also at AlertDefineServiceImpl.java.

@MasamiYui MasamiYui added the bug Something isn't working label Jan 20, 2025
@MasamiYui MasamiYui changed the title [BUG] Importing a large amount of monitoring data results occur poor experience and may trigger a long database transaction [BUG] Importing a large amount of monitoring config occur poor experience and may trigger a long database transaction Jan 20, 2025
@yunfan24
Copy link
Contributor

Hello, I have a question. If each configuration is imported as a separate transaction, how can we ensure the integrity of the imported data? In other words, if one configuration import fails, how should it be handled?

@MasamiYui
Copy link
Contributor Author

Hello, I have a question. If each configuration is imported as a separate transaction, how can we ensure the integrity of the imported data? In other words, if one configuration import fails, how should it be handled?

I think failure can be ignored may be more reasonable ;or adding a progress bar or a place to check the progress will be much better for batch import.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

3 participants