[CP] Fix: session sync related bug

This commit is contained in:
yaojing624
2023-09-26 06:10:06 +00:00
committed by ob-robot
parent 0be5791bd5
commit 8f6d380ccd
4 changed files with 68 additions and 49 deletions

View File

@ -249,7 +249,7 @@ public:
virtual ~ObSessInfoEncoder() {}
virtual int serialize(ObSQLSessionInfo &sess, char *buf, const int64_t length, int64_t &pos) = 0;
virtual int deserialize(ObSQLSessionInfo &sess, const char *buf, const int64_t length, int64_t &pos) = 0;
virtual int64_t get_serialize_size(ObSQLSessionInfo& sess) const = 0;
virtual int get_serialize_size(ObSQLSessionInfo& sess, int64_t &length) const = 0;
// When implementing new information synchronization,
// it is necessary to add a self-verification interface
// include fetch, compare, and error display.
@ -269,7 +269,7 @@ public:
~ObSysVarEncoder() {}
int serialize(ObSQLSessionInfo &sess, char *buf, const int64_t length, int64_t &pos);
int deserialize(ObSQLSessionInfo &sess, const char *buf, const int64_t length, int64_t &pos);
int64_t get_serialize_size(ObSQLSessionInfo& sess) const;
int get_serialize_size(ObSQLSessionInfo& sess, int64_t &length) const;
int fetch_sess_info(ObSQLSessionInfo &sess, char *buf, const int64_t length, int64_t &pos);
int64_t get_fetch_sess_info_size(ObSQLSessionInfo& sess);
int compare_sess_info(const char* current_sess_buf, int64_t current_sess_length,
@ -284,7 +284,7 @@ public:
~ObAppInfoEncoder() {}
int serialize(ObSQLSessionInfo &sess, char *buf, const int64_t length, int64_t &pos);
int deserialize(ObSQLSessionInfo &sess, const char *buf, const int64_t length, int64_t &pos);
int64_t get_serialize_size(ObSQLSessionInfo& sess) const;
int get_serialize_size(ObSQLSessionInfo& sess, int64_t &length) const;
int fetch_sess_info(ObSQLSessionInfo &sess, char *buf, const int64_t length, int64_t &pos);
int64_t get_fetch_sess_info_size(ObSQLSessionInfo& sess);
int compare_sess_info(const char* current_sess_buf, int64_t current_sess_length,
@ -312,7 +312,7 @@ public:
virtual ~ObAppCtxInfoEncoder() {}
virtual int serialize(ObSQLSessionInfo &sess, char *buf, const int64_t length, int64_t &pos) override;
virtual int deserialize(ObSQLSessionInfo &sess, const char *buf, const int64_t length, int64_t &pos) override;
virtual int64_t get_serialize_size(ObSQLSessionInfo& sess) const override;
virtual int get_serialize_size(ObSQLSessionInfo& sess, int64_t &length) const override;
virtual int fetch_sess_info(ObSQLSessionInfo &sess, char *buf,
const int64_t length, int64_t &pos);
virtual int64_t get_fetch_sess_info_size(ObSQLSessionInfo& sess);
@ -327,7 +327,7 @@ public:
virtual ~ObClientIdInfoEncoder() {}
virtual int serialize(ObSQLSessionInfo &sess, char *buf, const int64_t length, int64_t &pos) override;
virtual int deserialize(ObSQLSessionInfo &sess, const char *buf, const int64_t length, int64_t &pos) override;
virtual int64_t get_serialize_size(ObSQLSessionInfo &sess) const override;
virtual int get_serialize_size(ObSQLSessionInfo &sess, int64_t &length) const override;
virtual int fetch_sess_info(ObSQLSessionInfo &sess, char *buf,
const int64_t length, int64_t &pos);
virtual int64_t get_fetch_sess_info_size(ObSQLSessionInfo& sess);
@ -343,7 +343,7 @@ public:
virtual ~ObSequenceCurrvalEncoder() {}
virtual int serialize(ObSQLSessionInfo &sess, char *buf, const int64_t length, int64_t &pos) override;
virtual int deserialize(ObSQLSessionInfo &sess, const char *buf, const int64_t length, int64_t &pos) override;
virtual int64_t get_serialize_size(ObSQLSessionInfo &sess) const override;
virtual int get_serialize_size(ObSQLSessionInfo &sess, int64_t &length) const override;
virtual int fetch_sess_info(ObSQLSessionInfo &sess, char *buf, const int64_t length, int64_t &pos) override;
virtual int64_t get_fetch_sess_info_size(ObSQLSessionInfo& sess) override;
virtual int compare_sess_info(const char* current_sess_buf, int64_t current_sess_length,
@ -358,7 +358,7 @@ public:
virtual ~ObControlInfoEncoder() {}
virtual int serialize(ObSQLSessionInfo &sess, char *buf, const int64_t length, int64_t &pos) override;
virtual int deserialize(ObSQLSessionInfo &sess, const char *buf, const int64_t length, int64_t &pos) override;
virtual int64_t get_serialize_size(ObSQLSessionInfo &sess) const override;
virtual int get_serialize_size(ObSQLSessionInfo &sess, int64_t &length) const override;
virtual int fetch_sess_info(ObSQLSessionInfo &sess, char *buf,
const int64_t length, int64_t &pos);
virtual int64_t get_fetch_sess_info_size(ObSQLSessionInfo& sess);
@ -378,7 +378,7 @@ public:
virtual ~ObErrorSyncSysVarEncoder() {}
virtual int serialize(ObSQLSessionInfo &sess, char *buf, const int64_t length, int64_t &pos) override;
virtual int deserialize(ObSQLSessionInfo &sess, const char *buf, const int64_t length, int64_t &pos) override;
virtual int64_t get_serialize_size(ObSQLSessionInfo &sess) const override;
virtual int get_serialize_size(ObSQLSessionInfo &sess, int64_t &length) const override;
virtual int fetch_sess_info(ObSQLSessionInfo &sess, char *buf, const int64_t length, int64_t &pos) override;
virtual int64_t get_fetch_sess_info_size(ObSQLSessionInfo& sess) override;
virtual int compare_sess_info(const char* current_sess_buf, int64_t current_sess_length,
@ -392,7 +392,7 @@ class CLS final : public ObSessInfoEncoder { \
public: \
int serialize(ObSQLSessionInfo &sess, char *buf, const int64_t length, int64_t &pos) override; \
int deserialize(ObSQLSessionInfo &sess, const char *buf, const int64_t length, int64_t &pos) override; \
int64_t get_serialize_size(ObSQLSessionInfo &sess) const override; \
int get_serialize_size(ObSQLSessionInfo &sess, int64_t &length) const override; \
int fetch_sess_info(ObSQLSessionInfo &sess, char *buf, const int64_t length, int64_t &pos) override; \
int64_t get_fetch_sess_info_size(ObSQLSessionInfo& sess) override; \
int compare_sess_info(const char* current_sess_buf, int64_t current_sess_length, const char* last_sess_buf, int64_t last_sess_length) override; \