-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ADBDEV-6443: Refactor diskquota local hashmap with active tables #46
Conversation
The original problem you resolving is high memory usage for hash table, right? Also, this huge array (string) is used to be passed to UDF |
Yes
No! This line of serialized oids was there before the patch, including during initialization!
Unfortunately, the
This is beyond the scope of this patch. The fact that the |
Yes it was, so this patch does not resolve the problem completely.
?
Perhaps yes, but elaborating this approach can bring even more improvement and resolve the problem completely. |
This patch addresses a specific issue of increased memory consumption by the local hashmap during initialization. |
What problem are you talking about? This patch solves only one specific problem and nothing else. There are many other problems in |
Yes, I think I already wrote that the current implementation of direct dispatching allows dispatching only string commands without parameters. |
Refactor diskquota local hashmap with active tables
diskquota used a local hashmap local_table_stats_map in the
gp_fetch_active_tables function. During initialization, it loaded all the
information from the table with the sizes diskquota.table_size into it using
the load_table_size function. And during normal operation, diskquota loaded
information about active tables with sizes from segments into this local
hashmap using the pull_active_list_from_seg, convert_map_to_string, and
pull_active_table_size_from_seg functions. This led to increased memory
consumption, especially during initialization, since with a large number of
active tables (and all tables were considered active during initialization),
the size of this local hashmap local_table_stats_map was quite large. This
local_table_stats_map was then used in the calculate_table_disk_usage function
to calculate the sizes of active tables, and in the dispatch_rejectmap function
to dispatch active tables to segments.
This patch completely gets rid of the local_table_stats_map local hashmap,
calculating the sizes of active tables directly when receiving results in the
load_table_size and pull_active_table_size_from_seg functions, simultaneously
filling in the active_oids text list of active tables, which is then passed to
the dispatch_rejectmap function. The new get_table_size_map_entry and
update_active_table_size functions are extracted parts of the
calculate_table_disk_usage function code related to active tables. The
invalidation logic during initialization 14b861d has been completely reverted
because it is already covered by the current changes.
It is easier to view the changes with the "Hide whitespace" option enabled.