mirror of https://github.com/citusdata/citus.git
Add sort call to shard placement test
The comparator is kind of broken, but I think this is better than the current state of random failures.pull/807/head
parent
9ea36bb375
commit
ce0a0ab813
|
@ -19,10 +19,12 @@
|
||||||
|
|
||||||
#include "access/heapam.h"
|
#include "access/heapam.h"
|
||||||
#include "catalog/pg_type.h"
|
#include "catalog/pg_type.h"
|
||||||
|
#include "distributed/listutils.h"
|
||||||
#include "distributed/master_metadata_utility.h"
|
#include "distributed/master_metadata_utility.h"
|
||||||
#include "distributed/master_protocol.h"
|
#include "distributed/master_protocol.h"
|
||||||
#include "distributed/metadata_cache.h"
|
#include "distributed/metadata_cache.h"
|
||||||
#include "distributed/multi_join_order.h"
|
#include "distributed/multi_join_order.h"
|
||||||
|
#include "distributed/multi_physical_planner.h"
|
||||||
#include "distributed/pg_dist_shard.h"
|
#include "distributed/pg_dist_shard.h"
|
||||||
#include "distributed/resource_lock.h"
|
#include "distributed/resource_lock.h"
|
||||||
#include "distributed/test_helper_functions.h" /* IWYU pragma: keep */
|
#include "distributed/test_helper_functions.h" /* IWYU pragma: keep */
|
||||||
|
@ -144,6 +146,8 @@ load_shard_placement_array(PG_FUNCTION_ARGS)
|
||||||
placementList = ShardPlacementList(shardId);
|
placementList = ShardPlacementList(shardId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
placementList = SortList(placementList, CompareShardPlacements);
|
||||||
|
|
||||||
placementCount = list_length(placementList);
|
placementCount = list_length(placementList);
|
||||||
placementDatumArray = palloc0(placementCount * sizeof(Datum));
|
placementDatumArray = palloc0(placementCount * sizeof(Datum));
|
||||||
|
|
||||||
|
|
|
@ -128,7 +128,7 @@ ERROR: could not find valid entry for shard 540005
|
||||||
SELECT load_shard_placement_array(540001, false);
|
SELECT load_shard_placement_array(540001, false);
|
||||||
load_shard_placement_array
|
load_shard_placement_array
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
{localhost:57637,localhost:57638}
|
{localhost:57638,localhost:57637}
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- only one of which is finalized
|
-- only one of which is finalized
|
||||||
|
@ -142,7 +142,7 @@ SELECT load_shard_placement_array(540001, true);
|
||||||
SELECT load_shard_placement_array(540001, false);
|
SELECT load_shard_placement_array(540001, false);
|
||||||
load_shard_placement_array
|
load_shard_placement_array
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
{localhost:57637,localhost:57638}
|
{localhost:57638,localhost:57637}
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- should see column id of 'name'
|
-- should see column id of 'name'
|
||||||
|
|
Loading…
Reference in New Issue