fix get histogram memory leak and some failed cases
This commit is contained in:
		 wangt1xiuyi
					wangt1xiuyi
				
			
				
					committed by
					
						 wangzelin.wzl
						wangzelin.wzl
					
				
			
			
				
	
			
			
			 wangzelin.wzl
						wangzelin.wzl
					
				
			
						parent
						
							6710671db5
						
					
				
				
					commit
					dd96b22f55
				
			
							
								
								
									
										12
									
								
								deps/oblib/src/lib/stat/ob_di_tls.h
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								deps/oblib/src/lib/stat/ob_di_tls.h
									
									
									
									
										vendored
									
									
								
							| @ -18,10 +18,10 @@ | ||||
|  | ||||
| namespace oceanbase | ||||
| { | ||||
| namespace common | ||||
| { | ||||
|  | ||||
| template <class T> | ||||
| namespace common | ||||
| { | ||||
|  | ||||
| template <class T> | ||||
| class ObDITls | ||||
| { | ||||
| public: | ||||
| @ -66,5 +66,5 @@ T* ObDITls<T>::get_instance() | ||||
| } | ||||
|  | ||||
| } | ||||
| } | ||||
| #endif | ||||
| } | ||||
| #endif | ||||
|  | ||||
| @ -89,7 +89,7 @@ public: | ||||
|     pop_count_(0) | ||||
|     {} | ||||
|  | ||||
|   ~ObHistogram() {} | ||||
|   ~ObHistogram() { reset(); } | ||||
|  | ||||
|   void reset(); | ||||
|  | ||||
| @ -219,7 +219,7 @@ public: | ||||
|  | ||||
|   explicit ObOptColumnStat(common::ObIAllocator &allocator); | ||||
|  | ||||
|   ~ObOptColumnStat() {} | ||||
|   ~ObOptColumnStat() { histogram_.reset(); } | ||||
|  | ||||
|   uint64_t get_table_id() const { return table_id_; } | ||||
|   void set_table_id(uint64_t tid) { table_id_ = tid; } | ||||
|  | ||||
| @ -237,7 +237,10 @@ int ObOptStatService::load_column_stat_and_put_cache(const uint64_t tenant_id, | ||||
|         LOG_WARN("puts column stat into cache failed.", K(ret)); | ||||
|       } else if (OB_FAIL(handles.push_back(handle))) { | ||||
|         LOG_WARN("failed to push back", K(ret)); | ||||
|       } else {/*do nothing*/} | ||||
|       } else { | ||||
|         key_column_stats.at(i).stat_->~ObOptColumnStat(); | ||||
|         key_column_stats.at(i).stat_ = NULL; | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|   return ret; | ||||
|  | ||||
		Reference in New Issue
	
	Block a user