Issue information

Issue ID
#5410
Status
Confirmed
Severity
Fair
Started
Hercules Elf Bot
Mar 9, 2012 11:18
Last Post
Hercules Elf Bot
Mar 16, 2012 11:46
Confirmation
Yes (3)
No (0)

Hercules Elf Bot - Mar 9, 2012 11:18

Originally posted by [b]Mr. No One[/b]
Hello!

We're experimenting with running multiple map servers for load balancing. I made two maps, one only loaded by MS1, and the other by MS2, so I can travel between the servers. When I log in, it takes me to the primary map server (MS1). I can use @warp to go to MS2, but once there, I can not come back. If I make MS1 unreachable, char server logs me in to MS2, where the situation is exactly the same, only reversed. I can go to MS1, but can not come back. Therefore it should not be a config issue, since both map servers can transfer me to each other (once).

The list of issues with a scenario of traveling from MS1 to MS2, and then back to MS1:

1) With @warp: One way ticket from both directions
- The client says a map not found error, although the map server console shows nothing.

2) With npc, warp command: One way ticket from both directions
- Map server throws handled error: [Error]: buildin_warp: moving player 'xyz' to "transfer_01",49,49 failed.
- Map server sometimes throws unhanded pointer exceptions:
[Error]: Memory manager: args of aFree 0x0x10e247cc is invalid pointer script.c line 2831
[2012.03.09 11:53:55][Error]: Memory manager: args of aFree 0x0x111333b4 is invalid pointer script.c line 2833
[2012.03.09 11:53:55][Error]: Memory manager: args of aFree 0x0x10ebc224 is invalid pointer script.c line 2834
[2012.03.09 11:53:55][Error]: Memory manager: args of aFree 0x0xf2ef62c is invalid pointer script.c line 2836
- Map server may even crash, happened to me about 1 in 5 tries.

The only way to reset this state was a restart.

Does the map get somehow removed from map_index when it's on a remote server?

Hercules Elf Bot - Mar 9, 2012 11:31

Originally posted by [b]Gepard[/b]
Map that are not present on the map-server, but are on other map-server, as marked as such. Thus, every map is marked as either: [list=1]
[*]available locally
[*]available on other map-server
[*]unavailable
[/list]
Unfortunately, multi map-server support is broken. There are many issues and many bugreports about it. It needs a general review and bugfixing.

Hercules Elf Bot - Mar 9, 2012 11:40

Originally posted by [b]Mr. No One[/b]
Thanks for the quick response. Please allow me to ask one more question :)

Is there any chance that you or someone sees the challenge in this issue and will take up soon? Or should I completely forget about it?

I'd gladly offer any possible help to get this running again.

Hercules Elf Bot - Mar 10, 2012 10:55

Originally posted by [b]Gepard[/b]
This feature is rarely used, that's why it was never properly maintained, and that's why so many unreported bugs accumulated over time.

I could start fixing multi map-server support next week, and you could help simply by checking if fixes work and reporting any issues found with mms setup.

Hercules Elf Bot - Mar 10, 2012 20:38

Originally posted by [b]Mr. No One[/b]
Thank you very much, you are a hero :) Feel free to contact me if you need some feedback or help!

Hercules Elf Bot - Mar 13, 2012 18:31

Originally posted by [b]Gepard[/b]
I have tested it with two map-servers and following setup:

Map-server #1:[list]
[*]commented out [font=courier new,courier,monospace]map:geffen[/font] from [font=courier new,courier,monospace]conf/maps_athena.conf[/font]
[/list]
[font=arial, helvetica, sans-serif]Map-server #2:[/font][list]
[*][font=arial, helvetica, sans-serif]uses a copy of [font=courier new,courier,monospace]map_athena.conf[/font] with different [/font]port ([font=courier new,courier,monospace]map_athena2.conf[font=arial,helvetica,sans-serif]) and different [font=courier new,courier,monospace]maps_athena.conf[/font] with just one [font=courier new,courier,monospace]map:geffen[/font] ([font=courier new,courier,monospace]maps_athena2.conf[font=arial,helvetica,sans-serif], imported in [font=courier new,courier,monospace]map_athena2.conf[/font])[/font][/font][/font][/font]
[*][font=courier new,courier,monospace][font=arial,helvetica,sans-serif][font=courier new,courier,monospace][font=arial,helvetica,sans-serif]map-server is run with [font=courier new,courier,monospace]map-server_sql --map-config conf/map_athena2.conf[/font][/font][/font][/font][/font]
[/list]
[font=arial, helvetica, sans-serif]I was unable to reproduce this issue. I could freely move between map-servers with atcommands like @go and @warp.[/font]

Hercules Elf Bot - Mar 13, 2012 20:04

Originally posted by [b]Mr. No One[/b]
I worked with duplicated folders and changed the following:[list]
[*]Both: Added transfer_01 and transfer_02 to map_index.txt
[*]MS1: added transfer_01 to maps_athena.conf
[*]MS2: added transfer_02 to maps_athena.conf + changed port
[/list]
All other maps were still loaded, so with this setup it'd be more of a High Availability solution than a Load Balancing one.

---

Anyways, I tried to do it from one folder as you did.

I duplicated map_athena.conf as map2_athena.conf and changed these[list]
[*]import: conf/maps_athena.conf > import: conf/maps2_athena.conf
[*]import: conf/import/map_conf.txt > import: conf/import/map2_conf.txt
[/list]


Also duplicated those two files with the new names.
maps2_athena.conf contains only one line (without quotes, ofc): "map: geffen".
import/map2_conf.txt contains usual stuff like userid and passwd, char_ip, map_ip, a different map_port, plus "map: transfer_02"[list]
[*]MS1 loads, the maps are online, works fine.
[*]MS2 started with ./map-server_sql --map-config conf/map2_athena.conf
[*]MS2 loads 2 map, char server shows that its okay.
[/list]

But its now completely one-way from MS1 to MS2. MS2 can not warp to any maps except the 2 loaded by itself. That's probably because I misconfigured something, since it works for you.. If you can spot something in my setup, please let me know. It now doesn't work even with duplicated folders. The only thing I did since last time was an svn update.

In the next days I'll run a few more tries and report back if anything happens. Until that, I'll gladly receive tips with the issue.

This post has been edited by Mr. No One on Mar 13, 2012 20:05

Hercules Elf Bot - Mar 13, 2012 20:33

Originally posted by [b]Gepard[/b]
I enabled etc_log in conf/battle/misc.conf and noticed something weird:

[CODE]
[Status]: Received maps from 192.168.1.1:5121 (30 maps)[/CODE]
but it should be 805.

It looks like only first 30 maps are "seen" from another map-server. I couldn't @warp back to some newer maps, like dicastes01.

Hercules Elf Bot - Mar 13, 2012 20:46

Originally posted by [b]Gepard[/b]
# 1 fixed in [rev=15686].

This post has been edited by Gepard on Mar 14, 2012 0:00

Hercules Elf Bot - Mar 13, 2012 22:47

Originally posted by [b]Mr. No One[/b]
You are awesome, works (almost) perfectly!

I can warp between MSs smoothly, except with the npc I made. That still throws exceptions.

[quote]

[2012.03.13 23:36:23][Error]: Memory manager: args of aFree 0x0x10d1cd14 is invalid pointer script.c line 2831
[2012.03.13 23:36:23][Error]: Memory manager: args of aFree 0x0x110e03b4 is invalid pointer script.c line 2833
[2012.03.13 23:36:23][Error]: Memory manager: args of aFree 0x0x10dd14f4 is invalid pointer script.c line 2834
[2012.03.13 23:36:23][Error]: Memory manager: args of aFree 0x0xf2c03cc is invalid pointer script.c line 2836
[/quote]

The npc contains nothing special, just a switch-select + case & warp combo.

Oh! And really-really thanks for the parametered startup tip, it made the whole thing extremely easy :)

Hercules Elf Bot - Mar 14, 2012 0:02

Originally posted by [b]Gepard[/b]
This is caused by script stack being removed from memory in wrong moment. Basically, every script that moves player to another map-server can cause crashes because of that bug.

I'll try to fix it as well.

Hercules Elf Bot - Mar 15, 2012 22:15

Originally posted by [b]Mr. No One[/b]
Hey, I found something! I truly don't mean to annoy you, hope you still have patience :)

I planned an npc which would have to operate with character transfers via MSs, even vending, auto trading players. When I warp someone with a shop, the shop is gone on the other end. But when I warp someone who is auto trading, the player does not even appear on the other side, but stays online in the database.

Is it possible to keep (re-open?) the shops somehow? :( I hope so!

But even if not, the second phenomenon may still be called a bug.

Hercules Elf Bot - Mar 15, 2012 22:28

Originally posted by [b]Brian[/b]
I think that happens because when you warp to a map on another map-server, the "changing map-servers" operation is like logging out of map-server1 and logging into map-server2.

For example, you'll notice buffs are removed and reapplied.

Hercules Elf Bot - Mar 15, 2012 22:39

Originally posted by [b]Mr. No One[/b]
Yeah, that sounds logical. I haven't paid attention to the buffs to be honest, but since its another process which can even be on a remote server, I couldn't think of other methods to accomplish that :) Probably a lot of stuff like that I haven't thought about will be seen if the system will be online :)

The one million dollar question is whether this can be implemented to the "framework" that handles it without too much trouble, or not..? :)

Hercules Elf Bot - Mar 16, 2012 11:46

Originally posted by [b]Gepard[/b]
[quote name='Mr. No One' timestamp='1331849726' post='7613']
When I warp someone with a shop, the shop is gone on the other end. But when I warp someone who is auto trading, the player does not even appear on the other side, but stays online in the database.Is it possible to keep (re-open?) the shops somehow? :( I hope so!But even if not, the second phenomenon may still be called a bug.
[/quote]
If you warp someone autotrading, they never show up, because there is no client attached to send LoadEndAck (a packet that tells server that client is done loading map from GRF). The character is stuck in between maps until relog.

This post has been edited by Gepard on Mar 16, 2012 11:48