@@ -1393,7 +1393,7 @@ aqo_data_store(uint64 fs, int fss, OkNNrdata *data, List *reloids)
1393
1393
if (!found ) {
1394
1394
LWLockAcquire (& aqo_state -> neighbours_lock , LW_EXCLUSIVE );
1395
1395
1396
- prev = (NeighboursEntry * ) hash_search (fss_neighbours , & fss , HASH_ENTER , & found );
1396
+ prev = (NeighboursEntry * ) hash_search (fss_neighbours , & key . fss , HASH_ENTER , & found );
1397
1397
if (!found )
1398
1398
{
1399
1399
entry -> list .prev = NULL ;
@@ -1754,7 +1754,7 @@ _aqo_data_clean(uint64 fs)
1754
1754
dsa_free (data_dsa , entry -> data_dp );
1755
1755
entry -> data_dp = InvalidDsaPointer ;
1756
1756
1757
- /* fix fs list */
1757
+ /* fix neighbour list */
1758
1758
if (entry -> list .next )
1759
1759
has_next = true;
1760
1760
if (entry -> list .prev )
@@ -2100,11 +2100,14 @@ aqo_neighbours_reset(void)
2100
2100
elog (ERROR , "[AQO] hash table corrupted" );
2101
2101
num_remove ++ ;
2102
2102
}
2103
- aqo_state -> neighbours_changed = true;
2103
+
2104
+ if (num_remove > 0 )
2105
+ aqo_state -> neighbours_changed = true;
2106
+
2104
2107
LWLockRelease (& aqo_state -> neighbours_lock );
2105
2108
2106
2109
if (num_remove != num_entries )
2107
- elog (ERROR , "[AQO] Neighbour memory storage is corrupted or parallel access without a lock was detected." );
2110
+ elog (ERROR , "[AQO] Neighbours memory storage is corrupted or parallel access without a lock has detected." );
2108
2111
2109
2112
return num_remove ;
2110
2113
}
@@ -2232,7 +2235,7 @@ cleanup_aqo_database(bool gentle, int *fs_num, int *fss_num)
2232
2235
DataEntry * entry ;
2233
2236
NeighboursEntry * fss_htab_entry ;
2234
2237
2235
- /* fix fs list */
2238
+ /* fix neighbours list */
2236
2239
entry = (DataEntry * ) hash_search (data_htab , & key , HASH_FIND , & found );
2237
2240
if (found )
2238
2241
{
0 commit comments