uint32 hashcode = hash_any(entry, table->desc.key_size);
uint32 bucket = hashcode & table->bucket_mask;
CHashPtr *b = &table->bucket[bucket];
- bool cleanup_scan = false;
CHashScanResult scan;
/* Prevent garbage collection for this bucket. */
CHashPtrUnmark(next)))
CHashAddToGarbage(table, bucket, scan.target);
else
- cleanup_scan = true;
+ {
+ CHashScanResult cleanup_scan;
+
+ /*
+ * If we weren't able to remove the deleted item, rescan
+ * the bucket to make sure it's really gone. This is just
+ * like a regular bucket scan, except that we don't care
+ * about the results. We're just doing it to achieve the
+ * side-effect of removing delete-marked nodes from the
+ * bucket chain.
+ */
+ CHashTableIncrementStatistic(table, CHS_Cleanup_Scan);
+ CHashBucketScan(table, b, hashcode, entry, &cleanup_scan);
+ }
break;
}
CHashTableIncrementStatistic(table, CHS_Delete_Retry);
}
- /*
- * If we weren't able to remove the deleted item, rescan the bucket
- * to make sure it's really gone. This is just like a regular bucket
- * scan, except that we don't care about the results. We're just doing
- * it to achieve the side-effect of removing delete-marked nodes from
- * the bucket chain.
- */
- if (cleanup_scan)
- {
- CHashScanResult cleanup_scan;
-
- CHashTableIncrementStatistic(table, CHS_Cleanup_Scan);
- CHashBucketScan(table, b, hashcode, entry, &cleanup_scan);
- }
-
/* Allow garbage collection for this bucket. */
Assert(MyProc->hazard[0] != NULL);
pg_memory_barrier();