[OBKV] placeholder for adding rpc header flag to classify if is kvrequesu and kv request will use queue4
This commit is contained in:
		
							
								
								
									
										13
									
								
								deps/oblib/src/rpc/obrpc/ob_rpc_packet.h
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										13
									
								
								deps/oblib/src/rpc/obrpc/ob_rpc_packet.h
									
									
									
									
										vendored
									
									
								
							@ -154,6 +154,7 @@ public:
 | 
				
			|||||||
  static const uint16_t ENABLE_RATELIMIT_FLAG  = 1 << 8;
 | 
					  static const uint16_t ENABLE_RATELIMIT_FLAG  = 1 << 8;
 | 
				
			||||||
  static const uint16_t BACKGROUND_FLOW_FLAG   = 1 << 7;
 | 
					  static const uint16_t BACKGROUND_FLOW_FLAG   = 1 << 7;
 | 
				
			||||||
  static const uint16_t TRACE_INFO_FLAG        = 1 << 6;
 | 
					  static const uint16_t TRACE_INFO_FLAG        = 1 << 6;
 | 
				
			||||||
 | 
					  static const uint16_t IS_KV_REQUEST_FALG     = 1 << 5;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  uint64_t checksum_;
 | 
					  uint64_t checksum_;
 | 
				
			||||||
  ObRpcPacketCode pcode_;
 | 
					  ObRpcPacketCode pcode_;
 | 
				
			||||||
@ -271,6 +272,8 @@ public:
 | 
				
			|||||||
  inline bool unneed_response() const;
 | 
					  inline bool unneed_response() const;
 | 
				
			||||||
  inline void set_require_rerouting();
 | 
					  inline void set_require_rerouting();
 | 
				
			||||||
  inline bool require_rerouting() const;
 | 
					  inline bool require_rerouting() const;
 | 
				
			||||||
 | 
					  inline bool is_kv_request() const;
 | 
				
			||||||
 | 
					  inline void set_kv_request();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  inline bool ratelimit_enabled() const;
 | 
					  inline bool ratelimit_enabled() const;
 | 
				
			||||||
  inline void enable_ratelimit();
 | 
					  inline void enable_ratelimit();
 | 
				
			||||||
@ -494,6 +497,16 @@ bool ObRpcPacket::has_trace_info() const
 | 
				
			|||||||
  return hdr_.flags_ & ObRpcPacketHeader::TRACE_INFO_FLAG;
 | 
					  return hdr_.flags_ & ObRpcPacketHeader::TRACE_INFO_FLAG;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					bool ObRpcPacket::is_kv_request() const
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  return hdr_.flags_ & ObRpcPacketHeader::IS_KV_REQUEST_FALG;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void ObRpcPacket::set_kv_request()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  hdr_.flags_ |= ObRpcPacketHeader::IS_KV_REQUEST_FALG;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void ObRpcPacket::set_stream_next()
 | 
					void ObRpcPacket::set_stream_next()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  hdr_.flags_ &= static_cast<uint16_t>(~ObRpcPacketHeader::STREAM_LAST_FLAG);
 | 
					  hdr_.flags_ &= static_cast<uint16_t>(~ObRpcPacketHeader::STREAM_LAST_FLAG);
 | 
				
			||||||
 | 
				
			|||||||
@ -1313,6 +1313,12 @@ int ObTenant::recv_request(ObRequest &req)
 | 
				
			|||||||
            if (OB_FAIL(req_queue_.push(&req, QQ_NORMAL))) {
 | 
					            if (OB_FAIL(req_queue_.push(&req, QQ_NORMAL))) {
 | 
				
			||||||
              LOG_WARN("push request to QQ_NORMAL queue fail", K(ret), K(this));
 | 
					              LOG_WARN("push request to QQ_NORMAL queue fail", K(ret), K(this));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					          } else if (pkt.is_kv_request()) {
 | 
				
			||||||
 | 
					            // the same as sql request, kv request use q4
 | 
				
			||||||
 | 
					            ATOMIC_INC(&recv_np_rpc_cnt_);
 | 
				
			||||||
 | 
					            if (OB_FAIL(req_queue_.push(&req, RQ_NORMAL))) {
 | 
				
			||||||
 | 
					              LOG_WARN("push kv request to queue fail", K(ret), K(this));
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
          } else if (is_normal_prio(pkt) || is_low_prio(pkt)) {
 | 
					          } else if (is_normal_prio(pkt) || is_low_prio(pkt)) {
 | 
				
			||||||
            ATOMIC_INC(&recv_np_rpc_cnt_);
 | 
					            ATOMIC_INC(&recv_np_rpc_cnt_);
 | 
				
			||||||
            if (OB_FAIL(req_queue_.push(&req, QQ_LOW))) {
 | 
					            if (OB_FAIL(req_queue_.push(&req, QQ_LOW))) {
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user