@@ -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 )
@@ -2099,11 +2099,14 @@ aqo_neighbours_reset(void)
2099
2099
elog (ERROR , "[AQO] hash table corrupted" );
2100
2100
num_remove ++ ;
2101
2101
}
2102
- aqo_state -> neighbours_changed = true;
2102
+
2103
+ if (num_remove > 0 )
2104
+ aqo_state -> neighbours_changed = true;
2105
+
2103
2106
LWLockRelease (& aqo_state -> neighbours_lock );
2104
2107
2105
2108
if (num_remove != num_entries )
2106
- elog (ERROR , "[AQO] Neighbour memory storage is corrupted or parallel access without a lock was detected." );
2109
+ elog (ERROR , "[AQO] Neighbours memory storage is corrupted or parallel access without a lock has detected." );
2107
2110
2108
2111
return num_remove ;
2109
2112
}
@@ -2231,7 +2234,7 @@ cleanup_aqo_database(bool gentle, int *fs_num, int *fss_num)
2231
2234
DataEntry * entry ;
2232
2235
NeighboursEntry * fss_htab_entry ;
2233
2236
2234
- /* fix fs list */
2237
+ /* fix neighbours list */
2235
2238
entry = (DataEntry * ) hash_search (data_htab , & key , HASH_FIND , & found );
2236
2239
if (found )
2237
2240
{
0 commit comments