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

Refresh system index immediately when create/update/delete notification configs #790

Open
gaobinlong opened this issue Oct 13, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@gaobinlong
Copy link
Collaborator

Is your feature request related to a problem?

When create, update and delete notification configs, currently we do not refresh the system index .opensearch-notification-config in this plugin, so the operations cannot be seen immediately util the automatic refresh happens within the index(the default value of refresh_interval is 1s, which means the operations can be seen after 1s at most).

However, we can refresh the index when doing those operations to make the result visible immediately, one benefit is that users may use the notifications API to create/update/delete configs so they need to see the realtime result, another benefit is that in the integration test methods, we do not need to use Thread.sleep() or waitFor to wait some time to get the result after creating/updating/deleting the notification configs.

Too many refresh may cause problems, but in our case, creating/updating/deleting operations don't happen frequently, so it's not a problem that we refresh the system index for every operation.

What solution would you like?
Add refresh=true parameter when calling the index/update/delete API against the system index .opensearch-notification-config.

Here is the index operation code which needs to be changed:


, adding .setRefreshPolicy(RefreshPolicy.IMMEDIATE) maybe enough.

@gaobinlong gaobinlong added enhancement New feature or request untriaged good first issue Good for newcomers and removed untriaged labels Oct 13, 2023
@zhichao-aws
Copy link
Member

After changing this, we'd better modify our unit test to remove refreshAllIndices and Thread.sleep

@nishantb1
Copy link

I'll work on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants