@@ -93,62 +93,36 @@ async fn produce_replication<'a>(
93
93
Some ( Ok ( postgres_protocol:: message:: backend:: ReplicationMessage :: XLogData ( xlog_data) ) ) => {
94
94
last_data_message = Instant :: now( ) ;
95
95
match xlog_data. data( ) {
96
- LogicalReplicationMessage :: Origin ( origin) => {
97
- // metrics.transactions.inc();
98
- last_commit_lsn = PgLsn :: from( origin. commit_lsn( ) ) ;
99
-
100
- // println!("======== ORIGIN ==========");
101
- // let serialized_xlog = serde_json::to_string_pretty(&SerializedXLogDataBody(xlog_data)).unwrap();
102
- // println!("{}", serialized_xlog);
103
- // println!("======== END OF the ORIGIN MESSAGE JSON ==========");
104
-
105
- // for (output, row) in deletes.drain(..) {
106
- // yield Event::Message(last_commit_lsn, (output, row, -1));
107
- // }
108
- // for (output, row) in inserts.drain(..) {
109
- // yield Event::Message(last_commit_lsn, (output, row, 1));
110
- // }
111
- // yield Event::Progress([PgLsn::from(u64::from(last_commit_lsn) + 1)]);
112
- // metrics.lsn.set(last_commit_lsn.into());
96
+ LogicalReplicationMessage :: Origin ( _origin) => {
113
97
}
114
98
115
99
LogicalReplicationMessage :: Commit ( commit) => {
116
100
last_commit_lsn = PgLsn :: from( commit. end_lsn( ) ) ;
117
- // println!("======== COMMIT ==========");
118
- // let serialized_xlog = serde_json::to_string_pretty(&SerializedXLogDataBody(xlog_data)).unwrap();
119
- // println!("{}", serialized_xlog);
120
- // println!("======== END OF the COMMIT MESSAGE JSON ==========");
121
101
}
122
102
LogicalReplicationMessage :: Begin ( _begin) => {
123
- // last_commit_lsn = PgLsn::from(begin.final_lsn());
124
- // println!("======== BEGIN ==========");
125
- // let serialized_xlog = serde_json::to_string_pretty(&SerializedXLogDataBody(xlog_data)).unwrap();
126
- // println!("{}", serialized_xlog);
127
- // println!("======== END OF the BEGIN MESSAGE JSON ==========");
128
- //
129
103
}
130
- //
104
+
131
105
// LogicalReplicationMessage::Insert(_insert) => {
132
106
// println!("======== INSERT ==========");
133
107
// let serialized_xlog = serde_json::to_string_pretty(&SerializedXLogDataBody(xlog_data)).unwrap();
134
108
// println!("{}", serialized_xlog);
135
109
// println!("======== END OF the INSERT MESSAGE JSON ==========");
136
110
// }
137
- //
111
+
138
112
// LogicalReplicationMessage::Update(_update) => {
139
113
// println!("======== UPDATE ==========");
140
114
// let serialized_xlog = serde_json::to_string_pretty(&SerializedXLogDataBody(xlog_data)).unwrap();
141
115
// println!("{}", serialized_xlog);
142
116
// println!("======== END OF the UPDATE MESSAGE JSON ==========");
143
117
// }
144
- //
118
+
145
119
// LogicalReplicationMessage::Delete(_delete) => {
146
120
// println!("======== DELETE ==========");
147
121
// let serialized_xlog = serde_json::to_string_pretty(&SerializedXLogDataBody(xlog_data)).unwrap();
148
122
// println!("{}", serialized_xlog);
149
123
// println!("======== END OF the DELETE MESSAGE JSON ==========");
150
124
// }
151
- //
125
+
152
126
// LogicalReplicationMessage::Relation(_relation) => {
153
127
// println!("======== RELATION ==========");
154
128
// let serialized_xlog = serde_json::to_string_pretty(&SerializedXLogDataBody(xlog_data)).unwrap();
@@ -366,15 +340,13 @@ struct PublicationTables {
366
340
publication_tables : Vec < PostgresTableDesc > ,
367
341
}
368
342
369
- pub ( crate ) async fn replication ( connection_config : MzConfig , tx : Sender < tremor_value:: Value < ' static > > ) -> Result < ( ) , anyhow:: Error > {
370
- let publication = "gamespub" ;
343
+ pub ( crate ) async fn replication ( connection_config : MzConfig , publication : & str , slot : & str , tx : Sender < tremor_value:: Value < ' static > > ) -> Result < ( ) , anyhow:: Error > {
371
344
let publication_tables =
372
345
mz_postgres_util:: publication_info ( & connection_config, publication, None ) . await ?;
373
- let slot = "gamess" ;
374
346
let source_id = "source_id" ;
375
347
let mut _replication_lsn = PgLsn :: from ( 0 ) ;
376
348
377
- // println!("======== BEGIN SNAPSHOT ==========");
349
+ // println!("======== BEGIN SNA≠PSHOT ==========");
378
350
379
351
// Validate publication tables against the state snapshot
380
352
// dbg!(&publication_tables);
0 commit comments