tarantool 0.4.3.2 → 0.4.3.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,7 +26,9 @@ module Tarantool
26
26
  # general error return codes
27
27
  class BadReturnCode < StatusCode; end
28
28
  class NonMaster < BadReturnCode; end
29
+ class IsSecondaryPort < NonMaster; end
29
30
  class IllegalParams < BadReturnCode; end
31
+ class BadIntegrity < BadReturnCode; end
30
32
  class UnsupportedCommand < BadReturnCode; end
31
33
  class WrongField < BadReturnCode; end
32
34
  class WrongNumber < BadReturnCode; end
@@ -37,12 +39,15 @@ module Tarantool
37
39
  class StoredProcedureNotDefined < BadReturnCode; end
38
40
  class TupleExists < BadReturnCode; end
39
41
  class TupleDoesntExists < BadReturnCode; end
42
+ class DuplicateKey < BadReturnCode; end
40
43
  CODE_TO_EXCEPTION = {
41
44
  0x0401 => TupleReadOnly,
42
45
  0x0601 => TupleIsLocked,
43
46
  0x0701 => MemoryIssue,
44
47
  0x0102 => NonMaster,
45
48
  0x0202 => IllegalParams,
49
+ 0x0302 => IsSecondaryPort,
50
+ 0x0802 => BadIntegrity,
46
51
  0x0a02 => UnsupportedCommand,
47
52
  0x1e02 => WrongField,
48
53
  0x1f02 => WrongNumber,
@@ -53,6 +58,7 @@ module Tarantool
53
58
  0x3202 => StoredProcedureNotDefined,
54
59
  0x3302 => LuaError,
55
60
  0x3702 => TupleExists,
61
+ 0x3802 => DuplicateKey,
56
62
  }
57
63
  CODE_TO_EXCEPTION.default = BadReturnCode
58
64
  end
@@ -1,4 +1,4 @@
1
1
  module Tarantool
2
- VERSION = "0.4.3.2"
3
- RECORD_VERSION = "0.4.1.2"
2
+ VERSION = "0.4.3.3"
3
+ RECORD_VERSION = "0.4.2"
4
4
  end
@@ -0,0 +1,9 @@
1
+ module Tarantool
2
+ <<<<<<< HEAD
3
+ VERSION = "0.4.3.2"
4
+ RECORD_VERSION = "0.4.2"
5
+ =======
6
+ VERSION = "0.4.3.3"
7
+ RECORD_VERSION = "0.4.1.2"
8
+ >>>>>>> 90ffab2... fix exception for secondary port
9
+ end
@@ -577,6 +577,24 @@ shared_examples_for 'replication and shards' do
577
577
  ]}.must_equal [one, two]
578
578
  end
579
579
 
580
+ it "should not delete under wrong explicit shard" do
581
+ blockrun{[
582
+ space_both.shard(1).delete(1, return_tuple: true),
583
+ space_both.shard(0).delete(2, return_tuple: true)
584
+ ]}.must_equal [nil, nil]
585
+ end
586
+
587
+ it "should delete under right explicit shard" do
588
+ blockrun{[
589
+ space_both.shard(0).delete(1, return_tuple: true),
590
+ space_both.shard(1).delete(2, return_tuple: true),
591
+ space_both.shard(0).by_pk(1),
592
+ space_both.shard(1).by_pk(1),
593
+ space_both.shard(0).by_pk(2),
594
+ space_both.shard(1).by_pk(2)
595
+ ]}.must_equal [one, two, nil, nil, nil, nil]
596
+ end
597
+
580
598
  it "should call on both" do
581
599
  result = blockrun{ space_both.call('box.select_range', [0, 100]) }
582
600
  result.sort_by{|t| get_id(t)}.must_equal [one, two]
data/test/tarantool.cfg CHANGED
@@ -62,3 +62,9 @@ space[3].index[1].type = "TREE"
62
62
  space[3].index[1].unique = 0
63
63
  space[3].index[1].key_field[0].fieldno = 1
64
64
  space[3].index[1].key_field[0].type = "STR"
65
+
66
+ space[4].enabled = 1
67
+ space[4].index[0].type = "TREE"
68
+ space[4].index[0].unique = 1
69
+ space[4].index[0].key_field[0].fieldno = 0
70
+ space[4].index[0].key_field[0].type = "STR"
@@ -0,0 +1,25 @@
1
+ 1344852766.959 28990 1/spawner _ C> initialized
2
+ 1344852766.975 28988 1/sched _ I> space 0 successfully configured
3
+ 1344852766.975 28988 1/sched _ I> space 1 successfully configured
4
+ 1344852766.975 28988 1/sched _ I> space 2 successfully configured
5
+ 1344852766.975 28988 1/sched _ I> space 3 successfully configured
6
+ 1344852766.975 28988 1/sched _ I> recovery start
7
+ 1344852766.975 28988 1/sched _ I> recover from `./00000000000000000001.snap'
8
+ 1344852766.975 28988 1/sched _ I> snapshot recovered, confirmed lsn: 1
9
+ 1344852766.976 28988 1/sched _ I> building secondary indexes
10
+ 1344852766.976 28988 1/sched _ I> Building secondary keys in space 0...
11
+ 1344852766.976 28988 1/sched _ I> Space 0: done
12
+ 1344852766.976 28988 1/sched _ I> Building secondary keys in space 2...
13
+ 1344852766.976 28988 1/sched _ I> Space 2: done
14
+ 1344852766.976 28988 1/sched _ I> Building secondary keys in space 3...
15
+ 1344852766.976 28988 1/sched _ I> Space 3: done
16
+ 1344852766.976 28988 101/33013/primary _ I> bound to port 33013
17
+ 1344852766.976 28988 101/33013/primary _ I> I am primary
18
+ 1344852766.976 28988 102/33014/secondary _ I> bound to port 33014
19
+ 1344852766.977 28988 103/33015/admin _ I> bound to port 33015
20
+ 1344852766.977 28988 104/33016/replication _ I> bound to port 33016
21
+ 1344852766.977 28988 105/init.lua _ I> loading ./init.lua
22
+ 1344852766.977 28988 1/sched _ C> log level 4
23
+ 1344852766.977 28988 1/sched _ C> entering event loop
24
+ 1344852784.410 28988 1/sched _ C> exiting loop
25
+ 1344852784.412 28990 1/spawner _ I> Exiting: master shutdown
@@ -0,0 +1,64 @@
1
+ slab_alloc_arena = 0.1
2
+ pid_file = "box.pid"
3
+
4
+ logger="cat - >> tarantool.log"
5
+ work_dir="tarant1"
6
+
7
+ primary_port = 34013
8
+ secondary_port = 34014
9
+ admin_port = 34015
10
+ replication_port = 34016
11
+ #replication_source = "localhost:32016"
12
+
13
+ rows_per_wal = 50000
14
+
15
+ space[0].enabled = 1
16
+
17
+ space[0].index[0].type = "TREE"
18
+ space[0].index[0].unique = 1
19
+ space[0].index[0].key_field[0].fieldno = 0
20
+ space[0].index[0].key_field[0].type = "STR"
21
+
22
+ space[0].index[1].type = "TREE"
23
+ space[0].index[1].unique = 0
24
+ space[0].index[1].key_field[0].fieldno = 1
25
+ space[0].index[1].key_field[0].type = "STR"
26
+ space[0].index[1].key_field[1].fieldno = 2
27
+ space[0].index[1].key_field[1].type = "STR"
28
+
29
+ space[0].index[2].type = "TREE"
30
+ space[0].index[2].unique = 0
31
+ space[0].index[2].key_field[0].fieldno = 3
32
+ space[0].index[2].key_field[0].type = "NUM"
33
+
34
+ space[1].enabled = 1
35
+
36
+ space[1].index[0].type = "HASH"
37
+ space[1].index[0].unique = 1
38
+ space[1].index[0].key_field[0].fieldno = 0
39
+ space[1].index[0].key_field[0].type = "NUM"
40
+
41
+
42
+ space[2].enabled = 1
43
+
44
+ space[2].index[0].type = "TREE"
45
+ space[2].index[0].unique = 1
46
+ space[2].index[0].key_field[0].fieldno = 0
47
+ space[2].index[0].key_field[0].type = "STR"
48
+ space[2].index[0].key_field[1].fieldno = 1
49
+ space[2].index[0].key_field[1].type = "STR"
50
+
51
+ space[2].index[1].type = "TREE"
52
+ space[2].index[1].unique = 0
53
+ space[2].index[1].key_field[0].fieldno = 2
54
+ space[2].index[1].key_field[0].type = "NUM"
55
+
56
+ space[3].enabled = 1
57
+ space[3].index[0].type = "HASH"
58
+ space[3].index[0].unique = 1
59
+ space[3].index[0].key_field[0].fieldno = 0
60
+ space[3].index[0].key_field[0].type = "NUM"
61
+ space[3].index[1].type = "TREE"
62
+ space[3].index[1].unique = 0
63
+ space[3].index[1].key_field[0].fieldno = 1
64
+ space[3].index[1].key_field[0].type = "STR"
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tarantool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3.2
5
4
  prerelease:
5
+ version: 0.4.3.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Andrew Rudenko
@@ -10,17 +10,16 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-08-08 00:00:00.000000000 Z
13
+ date: 2012-11-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
- name: iproto
16
+ type: :runtime
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
21
21
  - !ruby/object:Gem::Version
22
22
  version: 0.3.8
23
- type: :runtime
24
23
  prerelease: false
25
24
  version_requirements: !ruby/object:Gem::Requirement
26
25
  none: false
@@ -28,15 +27,15 @@ dependencies:
28
27
  - - ! '>='
29
28
  - !ruby/object:Gem::Version
30
29
  version: 0.3.8
30
+ name: iproto
31
31
  - !ruby/object:Gem::Dependency
32
- name: murmurhash3
32
+ type: :runtime
33
33
  requirement: !ruby/object:Gem::Requirement
34
34
  none: false
35
35
  requirements:
36
36
  - - ! '>='
37
37
  - !ruby/object:Gem::Version
38
38
  version: 0.1.1
39
- type: :runtime
40
39
  prerelease: false
41
40
  version_requirements: !ruby/object:Gem::Requirement
42
41
  none: false
@@ -44,15 +43,15 @@ dependencies:
44
43
  - - ! '>='
45
44
  - !ruby/object:Gem::Version
46
45
  version: 0.1.1
46
+ name: murmurhash3
47
47
  - !ruby/object:Gem::Dependency
48
- name: sumbur
48
+ type: :runtime
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.0.2
55
- type: :runtime
56
55
  prerelease: false
57
56
  version_requirements: !ruby/object:Gem::Requirement
58
57
  none: false
@@ -60,15 +59,15 @@ dependencies:
60
59
  - - ! '>='
61
60
  - !ruby/object:Gem::Version
62
61
  version: 0.0.2
62
+ name: sumbur
63
63
  - !ruby/object:Gem::Dependency
64
- name: bin_utils
64
+ type: :runtime
65
65
  requirement: !ruby/object:Gem::Requirement
66
66
  none: false
67
67
  requirements:
68
68
  - - ! '>='
69
69
  - !ruby/object:Gem::Version
70
70
  version: 0.0.3
71
- type: :runtime
72
71
  prerelease: false
73
72
  version_requirements: !ruby/object:Gem::Requirement
74
73
  none: false
@@ -76,6 +75,7 @@ dependencies:
76
75
  - - ! '>='
77
76
  - !ruby/object:Gem::Version
78
77
  version: 0.0.3
78
+ name: bin_utils
79
79
  description: Tarantool KV-storage client.
80
80
  email:
81
81
  - ceo@prepor.ru
@@ -98,6 +98,7 @@ files:
98
98
  - lib/tarantool/core-ext.rb
99
99
  - lib/tarantool/serializers/ber_array.rb
100
100
  - lib/tarantool/serializers/bson.rb
101
+ - lib/tarantool/version.rb.orig
101
102
  - lib/tarantool/callback_db.rb
102
103
  - lib/tarantool/exceptions.rb
103
104
  - lib/tarantool/space_hash.rb
@@ -119,12 +120,14 @@ files:
119
120
  - test/helper.rb
120
121
  - test/test_query_fiber.rb
121
122
  - test/test_space_array_callback_nodef.rb
123
+ - test/tarantool1.cfg
122
124
  - test/init.lua
123
125
  - test/run_all.rb
124
126
  - test/test_space_array_callback.rb
125
127
  - test/test_space_array_fiber.rb
126
128
  - test/test_reshard_fiber.rb
127
129
  - test/test_query_block.rb
130
+ - test/tarantool.log
128
131
  - test/shared_reshard.rb
129
132
  - test/shared_query.rb
130
133
  - test/test_shard_replication_block.rb
@@ -173,12 +176,14 @@ test_files:
173
176
  - test/helper.rb
174
177
  - test/test_query_fiber.rb
175
178
  - test/test_space_array_callback_nodef.rb
179
+ - test/tarantool1.cfg
176
180
  - test/init.lua
177
181
  - test/run_all.rb
178
182
  - test/test_space_array_callback.rb
179
183
  - test/test_space_array_fiber.rb
180
184
  - test/test_reshard_fiber.rb
181
185
  - test/test_query_block.rb
186
+ - test/tarantool.log
182
187
  - test/shared_reshard.rb
183
188
  - test/shared_query.rb
184
189
  - test/test_shard_replication_block.rb