Skip to content

Conversation

cpegeric
Copy link
Contributor

@cpegeric cpegeric commented Oct 6, 2025

User description

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #22595

What this PR does / why we need it:

refactoring txnevent


PR Type

Enhancement


Description

  • Refactor TxnEvent callback system to support error handling

  • Add context parameter to all callback functions

  • Replace simple function callbacks with TxnEventCallback struct

  • Update all callback registrations across services


Diagram Walkthrough

flowchart LR
  A["Old Callback System"] --> B["TxnEventCallback Struct"]
  B --> C["Error Handling Support"]
  B --> D["Context Parameter"]
  C --> E["Service Updates"]
  D --> E
Loading

File Walkthrough

Relevant files
Tests
9 files
service_test.go
Update test mock callback signature                                           
+1/-1     
engine_mock.go
Update mock method signatures and parameters                         
+22/-20 
txn_mock.go
Update mock TxnOperator callback signature                             
+1/-1     
txn_test.go
Update test TxnOperator callback signature                             
+1/-1     
store_sql_test.go
Update test callback signature                                                     
+1/-1     
storage_test.go
Refactor test callbacks with error handling                           
+24/-20 
storage_test.go
Update test storage callbacks                                                       
+20/-16 
operator_events_test.go
Update test with new callback structure                                   
+6/-3     
entire_engine_test.go
Update test operator callback signature                                   
+1/-1     
Enhancement
10 files
service.go
Update callback registration with new wrapper                       
+4/-3     
store_mem.go
Refactor callback to return error and accept context         
+12/-10 
service.go
Update callback with error handling support                           
+7/-5     
service.go
Update service callbacks with new structure                           
+26/-22 
client.go
Update client callback registration and handlers                 
+11/-5   
operator.go
Core refactoring of callback system implementation             
+37/-17 
operator_events.go
Implement new callback structure and error handling           
+11/-6   
types.go
Define TxnEventCallback struct and helper functions           
+18/-1   
storage_txn_client.go
Update storage callback signature                                               
+1/-1     
service_txn_event.go
Update trace service callbacks with error handling             
+26/-20 

@cpegeric cpegeric changed the title refactoring TxnEvent to support callback data and return error with callback function refactoring TxnEvent to support callback data and return error with callback function (ISCP integration Step 1) Oct 10, 2025
Copy link
Contributor

@XuPeng-SH XuPeng-SH left a comment

Choose a reason for hiding this comment

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

It's just a temporary fix to test the functionality; it's not production-ready.

@fengttt fengttt merged commit 656cf7b into matrixorigin:main Oct 13, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/refactor Code refactor Review effort 3/5 size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants