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

[DSIP-56] Refactor JDBC registry support session timeout and data change event #16278

Closed
2 tasks done
Tracked by #14102
ruanwenjun opened this issue Jul 5, 2024 · 0 comments · Fixed by #16287
Closed
2 tasks done
Tracked by #14102

[DSIP-56] Refactor JDBC registry support session timeout and data change event #16278

ruanwenjun opened this issue Jul 5, 2024 · 0 comments · Fixed by #16287

Comments

@ruanwenjun
Copy link
Member

ruanwenjun commented Jul 5, 2024

Search before asking

  • I had searched in the DSIP and found no similar DSIP.

Motivation

DS have support to jdbc registry which will rely on mysql/pg to accomplice the service discovery. But there exist some problem in current implementation.

  • The architecture of jdbc registry is not clear, it's hard to maintain the code.
  • The data of client heartbeat is bind to the data, which make it's hard to debug.
  • Client doesn't support configuration e.g. session timeout, this make all client should have the same config.
  • If the a data is changed multiple times, the change event will lost, since the change event is generated by computation of two snapshot data.

Design Detail

image

JdbcRegistryServer

The JdbcRegistryServer represent the server side of JdbcRegistry, each service instance should create a JdbcRegistryServer. The JdbcRegistryServer is responsible to maintain the client's heart and response for the client's request.

Once the client's heartbeat doesn't refreshed success after client's session timeout, then the JdbcRegistryServer will clear the client's relation data.

JdbcRegistryClient

We can use JdbcRegistryClient to creat/delete data、acquire lock、 subscribe the data change event, connection change event.

t_ds_jdbc_registry_client_heartbeat

t_ds_jdbc_registry_client_heartbeat will store the active jdbc client heartbeat, once the jdbc client is dead , the server will delete the record in t_ds_jdbc_registry_client_heartbeat.

t_ds_jdbc_registry_data_change_event

t_ds_jdbc_registry_data_change_event will store the change event of t_ds_jdbc_registry_data, the server will detect the incremental events in this table and trigger data change event. Once we create/delete/update the record in t_ds_jdbc_registry_data, will insert a relation event to t_ds_jdbc_registry_data_change_event. Once the event is insert after 2h then it will be deleted.

Compatibility, Deprecation, and Migration Plan

Not compatibility with the old version, need to recreate the registry table.

Test Plan

No response

Code of Conduct

@ruanwenjun ruanwenjun added Waiting for reply Waiting for reply DSIP labels Jul 5, 2024
@SbloodyS SbloodyS removed the Waiting for reply Waiting for reply label Jul 5, 2024
@ruanwenjun ruanwenjun changed the title [DSIP-] JDBC registry support session timeout Jul 8, 2024
@ruanwenjun ruanwenjun changed the title [DSIP-] Refactor JDBC registry support session timeout and data change event Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants