Skip to content

Instantly share code, notes, and snippets.

@derryos
Last active December 15, 2015 11:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save derryos/8733a9feffaab29ffd44 to your computer and use it in GitHub Desktop.
Save derryos/8733a9feffaab29ffd44 to your computer and use it in GitHub Desktop.
Testing regression issue on 0.20.4 vs 0.90.RC1 with script testing and sample output. Just create 0.20.4 and 0.90.RC1 and then run script across both.
~$ bash test-es.sh
"number" : "0.20.4"
{"ok":true,"acknowledged":true}{
"count" : 0,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
}
}Should have gotten 0
{"ok":true,"acknowledged":true}{"ok":true,"acknowledged":true}{"ok":true}{"ok":true,"acknowledged":true}should have gotten no errors so far, now expect error
going to do a count on index
{
"count" : 0,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
}
}
should have gotten a shard exception on 090
~/elasticsearch-0.90.0.RC1-newAnalyzer$ bash test-es.sh
"number" : "0.90.0.RC1",
{"ok":true,"acknowledged":true}{
"count" : 0,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
}
}Should have gotten 0
{"ok":true,"acknowledged":true}{"ok":true,"acknowledged":true}{"ok":true}{"ok":true,"acknowledged":true}should have gotten no errors so far, now expect error
going to do a count on index
{
"count" : 0,
"_shards" : {
"total" : 5,
"successful" : 0,
"failed" : 5,
"failures" : [ {
"index" : "willnotworkones090rc1",
"shard" : 4,
"reason" : "BroadcastShardOperationFailedException[[willnotworkones090rc1][4] No active shard(s)]"
}, {
"index" : "willnotworkones090rc1",
"shard" : 2,
"reason" : "BroadcastShardOperationFailedException[[willnotworkones090rc1][2] No active shard(s)]"
}, {
"index" : "willnotworkones090rc1",
"shard" : 3,
"reason" : "BroadcastShardOperationFailedException[[willnotworkones090rc1][3] No active shard(s)]"
}, {
"index" : "willnotworkones090rc1",
"shard" : 0,
"reason" : "BroadcastShardOperationFailedException[[willnotworkones090rc1][0] No active shard(s)]"
}, {
"index" : "willnotworkones090rc1",
"shard" : 1,
"reason" : "BroadcastShardOperationFailedException[[willnotworkones090rc1][1] No active shard(s)]"
} ]
}
}should have gotten a shard exception on 090
#!/bin/sh
Get version
curl -XGET 'http://localhost:9200?pretty' | grep number
# Create index
curl -XPOST 'http://localhost:9200/willworkones090rc1/' -d '
{
"settings": {
"analysis": {
"analyzer": {
"esAnalyzer":{
"type":"stop",
"stopwords":["someword1","someword2"]
}
}
}
}
}'
sleep 5
# Should get a count of 0
curl -XGET 'http://localhost:9200/willworkones090rc1/_count?pretty'
echo "Should have gotten 0"
curl -XPUT 'http://localhost:9200/willnotworkones090rc1/'
curl -XPOST 'http://localhost:9200/willnotworkones090rc1/_close'
curl -XPUT 'http://localhost:9200/willnotworkones090rc1/_settings' -d '
{
"settings": {
"analysis": {
"analyzer": {
"esAnalyzer":{
"type":"stop",
"stopwords":["someword1","someword2"]
}
}
}
}
}'
curl -XPOST 'http://localhost:9200/willnotworkones090rc1/_open'
sleep 5
echo "should have gotten no errors so far, now expect error"
echo "going to do a count on index"
curl -XGET 'http://localhost:9200/willnotworkones090rc1/_count?pretty'
echo "should have gotten a shard exception on 090"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment